|
#1
|
|||
|
|||
|
How to put a variabele in a WriteFromString
TextFile.WriteFromString("d:\\check_password.sql", [[
bla bla bla bla want to put var in text file from SF7: %var% or ..var.. or ....... quit ]], false); Some one can help? |
|
#2
|
|||
|
|||
|
Hi,
The string can have the content of a LUA variable. If the text is assigned to a Session Variable, you first have to expand it. Code:
strMyText = SessionVar.Expand("%ProductName%".. " is installed in ".."%AppFolder%");
TextFile.WriteFromString("C:\\MyFile.txt", strMyText, false);
Dialog.Message("C:\\MyFile.txt","The text '"..strMyText.."' is now written to the file", MB_OK, MB_ICONNONE);
|
|
#3
|
|||
|
|||
|
i want to use a LUA var in a write.string thing (multiline). how to do then?
|
|
#4
|
|||
|
|||
|
Something like this?
Code:
strMyText = SessionVar.Expand("This text has".."\r\nbe displayed".."\r\non severel lines:".."\r\n".."\r\n%ProductName%".."\r\nis installed in".."\r\n%AppFolder%");
TextFile.WriteFromString("C:\\MyFile.txt", strMyText, false);
Code:
strMyText = SessionVar.Expand("This text has"
.."\r\nbe displayed"
.."\r\non severel lines:"
.."\r\n"
.."\r\n%ProductName%"
.."\r\nis installed in"
.."\r\n%AppFolder%");
|
|
#5
|
|||
|
|||
|
Nope, i have the following code:
In this code cq text file, i want to use LUA vars... Code:
TextFile.WriteFromString(strAppSqlDir.."\\check_password.sql", [[ WHENEVER OSERROR EXIT 32767 WHENEVER SQLERROR EXIT SQL.SQLCODE SET pause off SET heading off SET feedback off SET timing off SET termout off SET echo off SET verify off SET linesize 1000 SET pagesize 1000 TRIMSPOOL on connect sys/oracle1@%DatabaseNaam%; spool %AppSqlDir%\check_dbsyspass.txt select 'Ja' from dual; spool off connect system/oracle1@%db_naam%; spool %AppSqlDir%\check_dbsystempass.txt select 'Ja' from dual; spool off connect impulse/%ImpPass%@%db_naam%; spool %AppSqlDir%\check_dbimpulsepass.txt select 'Ja' from dual; spool off quit ]], false); |
|
#6
|
|||
|
|||
|
Nope?
You have another string than I have in my simple example, but the principle is the same. Just edit your string, be aware of quotation marks, and add some "\r\n" [=CR|LF]. |
|
#7
|
||||
|
||||
|
Quote:
It looks to me like it would be easier just to use the session variables, and expand the whole string like this: Code:
TextFile.WriteFromString(strAppSqlDir.."\\check_password.sql", SessionVar.Expand([[ WHENEVER OSERROR EXIT 32767 WHENEVER SQLERROR EXIT SQL.SQLCODE SET pause off SET heading off SET feedback off SET timing off SET termout off SET echo off SET verify off SET linesize 1000 SET pagesize 1000 TRIMSPOOL on connect sys/oracle1@%DatabaseNaam%; spool %AppSqlDir%\check_dbsyspass.txt select 'Ja' from dual; spool off connect system/oracle1@%db_naam%; spool %AppSqlDir%\check_dbsystempass.txt select 'Ja' from dual; spool off connect impulse/%ImpPass%@%db_naam%; spool %AppSqlDir%\check_dbimpulsepass.txt select 'Ja' from dual; spool off quit ]]), false); Code:
TextFile.WriteFromString(strAppSqlDir.."\\check_password.sql", [[ WHENEVER OSERROR EXIT 32767 WHENEVER SQLERROR EXIT SQL.SQLCODE SET pause off SET heading off SET feedback off SET timing off SET termout off SET echo off SET verify off SET linesize 1000 SET pagesize 1000 TRIMSPOOL on connect sys/oracle1@]]..strDatabaseNaam..[[; spool ]]..strAppSqlDir..[[\check_dbsyspass.txt select 'Ja' from dual; spool off connect system/oracle1@]]..db_naam..[[; spool ]]..strAppSqlDir..[[\check_dbsystempass.txt select 'Ja' from dual; spool off connect impulse/]]..strImpPass.."@"..db_naam..[[; spool ]]..strAppSqlDir..[[\check_dbimpulsepass.txt select 'Ja' from dual; spool off quit ]], false);
__________________
--[[ Indigo Rose Software Developer ]] |
|
#8
|
|||
|
|||
|
Lorne, I didn't know about the double angle brackets
[[ to create a block of text ]] Is it covered in the help doc? (I can't find it.) |
|
#9
|
||||
|
||||
|
It's on page 273 in the user's guide.
__________________
--[[ Indigo Rose Software Developer ]] |
|
#10
|
|||
|
|||
|
csd214: that's easier than your "\r\n" [=CR|LF]
|
|
#11
|
|||
|
|||
|
Quote:
(But the "\r\n" is working! I just tried to help you.) |
|
#12
|
|||
|
|||
|
You can also use the methods described to 'write-create' INI files
'on the fly' |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: How do I put a shortcut in startup menu | RickJ | Setup Factory 6.0 | 3 | 07-03-2003 09:17 AM |
| how can i put custom variables to the file ? | scottlee | Setup Factory 6.0 | 4 | 04-28-2003 10:42 AM |
| Put custom splash screen??? | mandark | Setup Factory 6.0 | 1 | 12-23-2002 09:07 AM |
| How do i put backgound music for my cd launcher ? | Flea | AutoPlay Media Studio 4.0 | 1 | 10-31-2002 08:44 AM |
| How to put a shortcut in quick launch bar? | liviolee | Setup Factory 6.0 | 2 | 03-19-2002 10:37 AM |
All times are GMT -6. The time now is 06:06 AM.








Linear Mode

