View Full Version : How to show Variables
Bruce
11-03-2003, 03:02 PM
In 4.0 I could ask to create a text file like this:
TextFile.Write ("C:\flash\%newname%.txt", "%newname%")
In 5.0 I don't know how to show the variable as an variable:
TextFile.WriteFromString("C:/flash/newname", "", false);
TJ_Tigger
11-03-2003, 03:38 PM
You will have to use the concatenate .. to combine the strings together. Or you can use the String.Concat to combine them as well. Try this
TextFile.WriteFromString("C:/flash/".. newname , "", false);
Bruce
11-03-2003, 04:41 PM
Thx for the reply Tigg...
I tried it out but it doesn't work.
What i'm doing is this, I am having the end user name a new text file by having them add the name in an input box. When they hit done, it's suppose to add a text file into a folder that's already on their drive with what ever they named it.
TextFile.WriteFromString("C:/flash/".. newfile, "", false);
I need a .txt extention on the end.
Can you elaborate?
Bruce
11-03-2003, 05:21 PM
I got it I think...
TextFile.WriteFromString("C:/flash/".."newflashcard.txt", "", false);
I needed to add the quotes" " around newflashcard.txt.
Thanks buddy!
Corey
11-03-2003, 05:23 PM
I put in the word for a knowledge base entry on the quotes and escape backslash Bruce so I'm sure something will pop-up at some point... Takes a minute to get used to but it makes sense once you get the hang of it. :)
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
Bruce
11-03-2003, 05:27 PM
Well, I was off base! It didn't work! POOP!
TIGGER HELP!
Bruce you need to do two concatations (is that a word?)
"C:\\folder\\"..newfile..".txt"
Bruce
11-03-2003, 07:51 PM
No i'm trying to make a text file with the name that the end user gives AMS.
I'll give that a try, Thanks
TJ_Tigger
11-03-2003, 08:26 PM
Yeah, sorry I forgot about the double \\ to escape the backslashes. That'll learn me to try it before I open my big mouth
Corey
11-03-2003, 08:54 PM
It's tricky until it becomes habit, we've all been got by that at one point. :)
A small knowledge base entry defintively outlining the new quotes and backslashes will give us somewhere to link people to...
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
Bruce
11-03-2003, 08:58 PM
Ok so should it look like this?
TextFile.WriteFromString("C:\flash\".. newname..".txt" , "", false); :confused:
TextFile.WriteFromString("C:\\flash\\".. newname..".txt" , "", false);
Bruce
11-03-2003, 09:09 PM
THAT'S IT! Thanks everyone! :D
Hi Bruce,
Remember it always depends upon what is a variable and what is a string. Strings always need to be within quotes, Variables do not, but they need to be concatenated with strings (..) if you want to ‘add’ them into a string..
I hope that information helps.
Bruce
11-04-2003, 01:07 AM
Thanks Mark
John-oh
11-04-2003, 02:49 PM
I think the punctuation has caused me more grief than anything (at least, in AMS) a knowledgebase article would seem a good idea.
I think its one of those things that after spending some time swearing at it, we'll get used to it, and swear by it.
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.