 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Tseik Guest
|
Posted: Thu Jul 17, 2008 10:42 am Post subject: Return problem. |
|
|
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
|
Posted: Thu Jul 17, 2008 10:56 am Post subject: |
|
|
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 |
|
 |
Tseik Guest
|
Posted: Thu Jul 17, 2008 11:08 am Post subject: |
|
|
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
|
Posted: Thu Jul 17, 2008 11:44 am Post subject: |
|
|
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 |
|
 |
tseik Guest
|
Posted: Thu Jul 17, 2008 12:24 pm Post subject: |
|
|
| doesnt work.. im no good.. =/ thanks anyways! |
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1203 Location: Denmark
|
Posted: Thu Jul 17, 2008 12:32 pm Post subject: |
|
|
| 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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|