Jump to content



Photo

"For" With "case"


  • Please log in to reply
3 replies to this topic

#1 GordonFreeman

GordonFreeman

    Adventurer

  • Active Members
  • PipPip
  • 103 posts

Posted 26 February 2012 - 05:14 AM

I need:

For $i = 1 to 5
case $i
$read = IniRead("test.ini", "test", "test" & $i, "error")
Next

Well, I need it to not have to define the various cases in my script already that they perform the same function

logically instead of numbers has to be the respective names of the variables


is it possible? or I have to define each case

Edited by GordonFreeman, 26 February 2012 - 05:22 AM.








#2 Blue_Drache

Blue_Drache

    Revolutionary Flavour

  • Active Members
  • PipPipPipPipPipPip
  • 3,221 posts

Posted 26 February 2012 - 05:40 AM

Look up Arrays in the help file.

Dim $read[6] For $i=1 to 5   $read[$i] = IniRead("test.ini", "test", "test" & $i, "error") Next

Edited by Blue_Drache, 26 February 2012 - 05:41 AM.

Lofting the cyberwinds on teknoleather wings, I am...The Blue DrachePosted ImagePosted Image

#3 GordonFreeman

GordonFreeman

    Adventurer

  • Active Members
  • PipPip
  • 103 posts

Posted 26 February 2012 - 06:03 AM

Exactly, I was supposed to exemplify this, but need to do this the button, since their names are the buttons: $ button1, $ button2, $ button3, $ button4, $button5

anyway, I appreciate the help

#4 Blue_Drache

Blue_Drache

    Revolutionary Flavour

  • Active Members
  • PipPipPipPipPipPip
  • 3,221 posts

Posted 26 February 2012 - 10:59 AM

It doesn't matter what you call the array... You can call it $read[x] or you can call it $button[x]
Lofting the cyberwinds on teknoleather wings, I am...The Blue DrachePosted ImagePosted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users