CIniFile: Difference between revisions
m
Sets _not_ Gets!
m (Using "source" tag) |
m (Sets _not_ Gets!) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 18: | Line 18: | ||
==Visual DataFlex Workspace files== | ==Visual DataFlex Workspace files== | ||
Another example are the workspace configuration files used by [[Visual DataFlex]] itself (by default named "Config.ws", showing that they don't have to use the .ini extension - see the | Another example are the workspace configuration files used by [[Visual DataFlex]] itself (by default named "Config.ws", showing that they don't have to use the .ini extension - see the article in "See Also" below), which must exist in the same directory the program is run from (usually the "Programs" subdirectory of the workspace). Here is an example: | ||
<source lang="ini"> | <source lang="ini"> | ||
Line 105: | Line 105: | ||
// Set the properties to make the information persistent | // Set the properties to make the information persistent | ||
Set psServer to sServer | |||
Set psLogin to sLogin | |||
Set psPassword to sPW | |||
Set psDriver to sDrv | |||
Set psDatabase to sDB | |||
Set pbDoLogin to bDB | |||
</source> | </source> | ||
Line 117: | Line 117: | ||
You could save some code by not retrieving the properties into local variables first, but using the properties as defaults directly: | You could save some code by not retrieving the properties into local variables first, but using the properties as defaults directly: | ||
<source lang=" | <source lang="dataflex"> | ||
Move (ReadString(hoIni, "Database Login", "Server", psServer(Self))) to sServer | Move (ReadString(hoIni, "Database Login", "Server", psServer(Self))) to sServer | ||
Move (ReadString(hoIni, "Database Login", "Login", psLogin(Self))) to sLogin | Move (ReadString(hoIni, "Database Login", "Login", psLogin(Self))) to sLogin | ||
Line 128: | Line 128: | ||
Or even dispense with the local variables completely: | Or even dispense with the local variables completely: | ||
<source lang=" | <source lang="dataflex"> | ||
Set psServer to (ReadString(hoIni, "Database Login", "Server", psServer(Self))) | Set psServer to (ReadString(hoIni, "Database Login", "Server", psServer(Self))) | ||
Set psLogin to (ReadString(hoIni, "Database Login", "Login", psLogin(Self))) | Set psLogin to (ReadString(hoIni, "Database Login", "Login", psLogin(Self))) |