Old 6th May 2007, 20:36   #1
neil.benn
Junior Member
 
Join Date: May 2005
Posts: 8
Assign an Integer Value to a Variable

Hello,

This is gonna seem like a really stupid question but here goes. I have a variable I have defined say var MY_COUNTER. I have worked out how to add 1 to it by using IntOp. However what I cannot work out how to do is to set it to a particular number, say 5685 or 6457, etc.

Err, this is gonna sound stupid but how to I do that? Sorry to ask such a basic question but I cannot find an answer in the docs, web search or anything!!

Thanks in advance.

Cheers,

Neil
neil.benn is offline   Reply With Quote
Old 6th May 2007, 21:04   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Either you mean StrCpy $MY_COUNTER 6457 or I'm completely confused.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 6th May 2007, 21:15   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 3,349
In nsis, all variables and registers (and the stack) are strings internally, so when you use IntOp the string is converted to a number and back

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 6th May 2007, 21:17   #4
neil.benn
Junior Member
 
Join Date: May 2005
Posts: 8
Hello,

That's it understand now - thanks. I was not using strcpy because I wanted to assign an int - not a string. However if everything is a string inside and strcpy works then I understand.

Thanks fro your help.

Cheers,

Neil
neil.benn is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump