Great! I didn't know this approach - I had to compile the .rc file with brcc32.exe and include the resulting .res file with the "{$R" directive, something like {$R ..\VersionInfo.RES}
Edwin Yip it's great. I'm going to use it soon to bind some large .txt files into an executable (predefined queries). Unlike some other people that prefer the "lets convert it to Pascal source with manual intervention first and have two versions of the query that need to be kept in sync" way of working.
Jeroen Wiert Pluimers For that specific purpose, you might want to take advantage of the "Paste Strings As" and the "Copy as raw string" GExperts, both these two functions are intelligent enough and has been working very well for me!
Jeroen Wiert Pluimers Up to 4k per string you can use a STRINGTABLE resource. For any text larger than that, you can either split them in 4k chunks or just use RCDATA or user-defined.
Jeroen Wiert Pluimers If I understand you correctly, no, you don't have to maintain two copies of your text. You can copy the text in its original form, if it's SQL, you get your original SQL statement.
Edwin Yip SQL also uses single quotes for strings. So now they need to be escaped and probably wrapped. When you now look for a solution statement logged by your DBMS in your source files you cannot find it.
I did some checking. This might even be supported as far back as Delphi 2006.
ReplyDeleteGreat! I didn't know this approach - I had to compile the .rc file with brcc32.exe and include the resulting .res file with the "{$R" directive, something like {$R ..\VersionInfo.RES}
ReplyDeleteEdwin Yip it's great. I'm going to use it soon to bind some large .txt files into an executable (predefined queries).
ReplyDeleteUnlike some other people that prefer the "lets convert it to Pascal source with manual intervention first and have two versions of the query that need to be kept in sync" way of working.
Jeroen Wiert Pluimers For that specific purpose, you might want to take advantage of the "Paste Strings As" and the "Copy as raw string" GExperts, both these two functions are intelligent enough and has been working very well for me!
ReplyDeleteA g+ post without a link but with comments?
ReplyDeleteThomas Mueller This g+ post contains a link to http://tondrej.blogspot.com/2016/08/include-resource-files-in-your-delphi.html - does it not for you?
ReplyDeleteJeroen Wiert Pluimers Up to 4k per string you can use a STRINGTABLE resource. For any text larger than that, you can either split them in 4k chunks or just use RCDATA or user-defined.
ReplyDeleteOndrej Kelle of course it's gonna be RCDATA. I've done this before, just a long time ago.
ReplyDeleteEdwin Yip nope. I'm not going to maintain two sources for the same text.
ReplyDeleteOndrej Kelle The link is there now, in the browser on my PC. When I watched it in the g+ app on my Android smartphone the content was empty.
ReplyDeleteSame here Thomas Mueller.
ReplyDeleteThomas Mueller I have that all the time with links and pictures. It's a cloud thing that happens both on a PC and on mobile.
ReplyDeleteRemember: "There is no cloud. It's just someone else's computer"
Jeroen Wiert Pluimers If I understand you correctly, no, you don't have to maintain two copies of your text. You can copy the text in its original form, if it's SQL, you get your original SQL statement.
ReplyDeleteEdwin Yip you will need two copies as this way you cannot search through the text in its original form as it has been quote encoded.
ReplyDeleteJeroen Wiert Pluimers Oh I see, in my case it's SQL statements so there is no search problem, but it seems that your case is slightly different :)
ReplyDeleteEdwin Yip SQL also uses single quotes for strings. So now they need to be escaped and probably wrapped. When you now look for a solution statement logged by your DBMS in your source files you cannot find it.
ReplyDelete