PDA

View Full Version : Good Day



AudioSam
02-02-2008, 01:27 PM
I have a small question .....
I am attempting to write from a table to a txt file.
I have some places I want to write the "" .
Example
ms15 = ("if Blah ~= "" then")
How to do that?

My Thank U's in advance.:)

TimeSurfer
02-02-2008, 02:22 PM
what are you trying to do sam? are you trying to check if a var isnt nil? or are you trying to check if a variable doesnt equal literal string ""? if your trying to check against the literal string "" then you must escape the ".

not sure which your wanting but heres an example of both bro.


if blah ~= nil then
do something here
end


if blah ~= ams = "\"\""
do something here
end

AudioSam
02-02-2008, 02:27 PM
I am taking that

ms15 = ("if Blah ~= "" then")

later I am doing this with many items....

Table.Insert(InfoTab, 15, ms15)


TextFile.WriteFromTable("C:\\PassWord.txt", InfoTab, false)

I need to write the quotes but I can't figure out how.

Any Ideas???

Sam

TimeSurfer
02-02-2008, 02:31 PM
well in order to output a " you need to escape it. let me play around for a sec and i may have a solution for you.

TimeSurfer
02-02-2008, 02:44 PM
here you go sam, the dialog message is just so i could test it.


ms15 = ("if Blah ~= \"\" then");
InfoTab = {}
Table.Insert(InfoTab, 15, ms15)
Dialog.Message("Notice", InfoTab[15], MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

AudioSam
02-02-2008, 02:49 PM
I'm messin around with the password apps..
I think I may come up with something pretty good.

I'm kinda figuring out the encryption scripts..
I'm sure it's nothing that you guys couldn't do in 5 minutes..
Because I spend all night, get no sleep, what I do is worth wayyyy more..
:lol:D:lol
Thank you,
AudioSam

TimeSurfer
02-02-2008, 02:55 PM
awesome sam, im also working on a password/serial type of app that utilizes mysql. I believe RizlaUk is also working on something similiar in fact i think he's almost done.

btw im not a l33t coder lol, i just have previous scripting exp from mIRC as well as win32 dialog scripting using Visual Dialog Script, and im just now learning purebasic.

AudioSam
02-02-2008, 02:59 PM
Cause what I got going here is HOT....:huh
Yeah,,,, right.....:D

You just wait..
One of these days,
I'm going to put something together really good.

Thanks for all the help,
Sam

RizlaUK
02-02-2008, 05:17 PM
I need to write the quotes but I can't figure out how.

whenever quotes are needed (dll calls, sqlite and mysql among others) i always use a Enclose function



function EncloseText(strText)
return "\""..strText.."\""
end

--Example Use:
Dialog.Message("Notice", EncloseText("This text will have quotes"), MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);