AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Return problem.

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Tseik
Guest





PostPosted: Thu Jul 17, 2008 10:42 am    Post subject: Return problem. Reply with quote

Cant find or understand how this works, i`m in loop!

Titan`s Function:

ini_GetSections(ByRef var) {
NumPut(160, var, 0, "UChar")
Loop, Parse, var, `n
{
StringGetPos, p, A_LoopField, /
StringLeft, n, A_LoopField, p
n = %n%`n
If (!InStr(s, n))
s = %s%%n%
}
NumPut(0, var, 0, "UChar")
Return, s
}

--------------------------------

How can i read return?
msgbox, %WhatAndHow%

=P
Back to top
Krogdor



Joined: 18 Apr 2008
Posts: 1025
Location: The Interwebs

PostPosted: Thu Jul 17, 2008 10:56 am    Post subject: Reply with quote

You want to read the return from the function?

To var:
Code:
SomeVar := Ini_GetSections(OtherVar)

To MsgBox:
Code:
MsgBox, % Ini_GetSections(OtherVar)
Back to top
View user's profile Send private message AIM Address
Tseik
Guest





PostPosted: Thu Jul 17, 2008 11:08 am    Post subject: Reply with quote

Sry, my skills are low!
Yes, i want to read the return from the function to var.
What is OtherVar then? =)

I want to read all section from c:\file.ini and then return that information to var "Sects".

Am i stupid.. =D
Back to top
tonne



Joined: 06 Jun 2006
Posts: 1203
Location: Denmark

PostPosted: Thu Jul 17, 2008 11:44 am    Post subject: Reply with quote

Titan use
Code:
NumPut(0, var, 0, "UChar")
to hide the value and
Code:
NumPut(160, var, 0, "UChar")
to unhide the value.
After calling the function do:
Code:
NumPut(32, WhatAndHow, 0, "UChar") ; unhide with space
MsgBox %WhatAndHow%

Not testet, though.
_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
tseik
Guest





PostPosted: Thu Jul 17, 2008 12:24 pm    Post subject: Reply with quote

doesnt work.. im no good.. =/ thanks anyways!
Back to top
tonne



Joined: 06 Jun 2006
Posts: 1203
Location: Denmark

PostPosted: Thu Jul 17, 2008 12:32 pm    Post subject: Reply with quote

Code:
; 1.ini:
; [sectiona]
; keya1=valuea1
;
; [sectionb]
; keyb1=valueb1
;
;[sectionc]
;keyc1=valuec1

#include ini.ahk

ini_load(inivar, "1.ini")
sections := ini_getsections(inivar)
numput(10,sections,0,"uchar")
msgbox %sections%

_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group