Jump to content
Sign in to follow this  
pezo89

while 1 +1 after one loop is completed

Recommended Posts

pezo89

Hello, i where just wondering what the command for loop + was again?

im currently reading info from a cell and posts it into word,

and im trying to have it go one cell down after each time the entire script is done.

also beeing able to have it set how many times it should loop

$sFilePath1 = @ScriptDir & "\Jobber som skal søkes på.xlsx" ;This file should already exist
$oExcel = _ExcelBookOpen($sFilePath1)
$i =+1



$url = _ExcelReadCell($oExcel, 1+$i, 7);Første URL
$stillingstype = _ExcelReadCell($oExcel, 1+$i, 8);FørsteFørsteStillingstype

and so on, so say that i on start a script with an input bar, and inputs the number 3 and it loops it 3 times, and also on the end of each loop it goes one cell down.

Share this post


Link to post
Share on other sites
pezo89

A For-loop?

From helpfile:

For $i = 5 to 1 Step -1
    MsgBox(0, "Count down!", $i)
Next
MsgBox(0,"", "Blast Off!")

yes something like that. but how can i set the "timer" myself, with an inputbox?

Share this post


Link to post
Share on other sites
pezo89

yes something like that. but how can i set the "timer" myself, with an inputbox?

nvm figuered it out. thanks alot

$o =+ InputBox("Test","Test","2")
For $i =+$o to 1 Step -1
    MsgBox(0, "Count down!", $i)
Next
MsgBox(0,"", "Blast Off!")

Share this post


Link to post
Share on other sites
AdmiralAlkex

Then I must be missing something.

$o = InputBox("Test","Test","2")
For $i = 1 to $o
    MsgBox(0, "Count down!", $i)
Next
MsgBox(0,"", "Blast Off!")

That's how I imagine what pezo wants.

Share this post


Link to post
Share on other sites
czardas

Just to clarify:

$o =+1 sets $o equal to 1 (the + sign is not needed => $o = 1)

$o =-1 sets $o equal to -1

$o += 1 (increments the value of $o by one)

$o -= 1 (decreases the value of $o by one)

Share this post


Link to post
Share on other sites
trancexx

Just to clarify:

$o =+1 sets $o equal to 1 (the + sign is not needed => $o = 1)

$o =-1 sets $o equal to -1

$o += 1 (increments the value of $o by one)

$o -= 1 (decreases the value of $o by one)

And /= does that other thing and *= other other.

Btw, what's $o here?

$o =+-+-+-+-+-++++++++++-----------------------++-+ 8

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
czardas

And /= does that other thing and *= other other.

Btw, what's $o here?

$o =+-+-+-+-+-++++++++++-----------------------++-+ 8

I have no idea. Somehow I don't think it's +-+-+-+-+-++++++++++-----------------------++-+ message box.

Share this post


Link to post
Share on other sites
pezo89

ahh i see.. thanks alot for the help fellas :graduated:

Share this post


Link to post
Share on other sites
kaotkbliss

Btw, what's $o here?

$o =+-+-+-+-+-++++++++++-----------------------++-+ 8

my guess is -8 (because there are more - than +)

*and after entering that line into a script and inserting a msgbox to display the result... I was right :graduated:


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites
Tvern

Actually it's negative because there is an uneven amount of negatives. The plusses do nothing.

+8 = 8

+-8 = -8

--8 = 8

---8 = -8

+++++++++++++++++++++++++++-8 = 8

etc.

Share this post


Link to post
Share on other sites
kaotkbliss

run this code and see what you get...

$o =+-+-+-+-+-++++++++++-----------------------++-+ 8

MsgBox(0,"",$o)

*edit*

wait a sec, my answer was -8 and you said "actually it's negative..."

same answer. :graduated:

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites
Tvern

Actually it's negative because......

was a response to

(because there are more - than +)

Your answer was right, but the reasoning wasn't.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.