Modifying variable loaded in from text

  • hotgraphix
  • Born
  • Born
  • hotgraphix
  • Posts: 3

Post 3+ Months Ago

Is it possible to modify a variable such as &text=5 that was loaded in from a text file?

Can you do something like:
newVariable = text + 4

Thus making 'newVariable' equal to 9.

I would greatly appreciate your input. Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

yea, sure u can
load the variable(s) with loadVariablesNum and then u can use them like local variables.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

If theese variables will need to be sent out again you can also change the variables within the object.
Code: [ Select ]
&var0=0&var1=1

Code: [ Select ]
varObj = new LoadVars();

varObj.load("pathToVars.txt");

varObj.var0 = parseInt(varObj.var0) + 1;
varObj.var1 = parseInt(varObj.var1) + 1;

varObj.send("pathToSendTo.cfm");
  1. varObj = new LoadVars();
  2. varObj.load("pathToVars.txt");
  3. varObj.var0 = parseInt(varObj.var0) + 1;
  4. varObj.var1 = parseInt(varObj.var1) + 1;
  5. varObj.send("pathToSendTo.cfm");

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 13 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.