Posted: Sat Aug 11, 2007 2:32 pm
How about d|e|f then you could just parse it as a string hehehe
http://www.purebasic.com
https://www.purebasic.fr/english/
I know, I was just answering his question : how to procedure return several parameters.Kaeru Gaman wrote:gnozals solution has one little weakness:
the return-struct is static, so it will stay inside the procedure.
he is just assigning a structured pointer to it.
Yes, that's how I usually do it.Kaeru Gaman wrote:for WinAPI calls that need a structured return,
you create your structured variable before the call and pass it's pointer to the routine.
I know you knew, I was just giving additional information to let him avoid mistakes.I know, I was just answering his question
Code: Select all
The NetUserGetInfo function retrieves information about a particular user account on a server.
NET_API_STATUS NetUserGetInfo(
LPCWSTR servername,
LPCWSTR username,
DWORD level,
LPBYTE* bufptr
);
If it's good enough for the win32api, it's good enough for meParameters
servername
[in] Pointer to a constant string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used.
Windows NT: This string must begin with \\.
username
[in] Pointer to a constant string that specifies the name of the user account for which to return information. For more information, see the following Remarks section.
level
[in] Specifies the information level of the data. This parameter can be one of the following values.
bufptr
[out] Pointer to the buffer that receives the data. The format of this data depends on the value of the level parameter. This buffer is allocated by the system and must be freed using the NetApiBufferFree function. For more information, see Network Management Function Buffers and Network Management Function Buffer Lengths.
Return Value
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value can be one of the following error codes.
Code: Select all
SUB Example (x%,y,z$) STATIC
x%=x%+2
y=y*5
z$=z$+" Example"
END SUB
x%=1.5 : y=5 : z$="SUB"
Call Example (a%,b,c$)
a% ;now=3.5
b ;now=25
c$ ;now=SUB Example
Code: Select all
Procedure Testing(temp1,temp2)
temp1=10:temp2=20
*temp3=@temp1
*temp4=@temp2
PokeL(?mydata,temp2)
EndProcedure
Testing(5,5)
Debug PeekL(?mydata+4)
;Debug *temp4
DataSection
mydata:
Data.l 0,55
EndDataSection
Code: Select all
Procedure MouseOverFontChange(Button,StatusText.s,temp1,temp2)
If IsMouseOver(Button)
If temp1<>1
StatusBarText(#StatusBar_Window_0,0,StatusText,#PB_StatusBar_BorderLess)
SetGadgetFont(Button,FontID(2))
temp1=1
EndIf
temp2=0
EndIf
If Not IsMouseOver(Button)
If temp2<>1
StatusBarText(#StatusBar_Window_0,0,"",#PB_StatusBar_BorderLess)
SetGadgetFont(Button,FontID(1))
temp2=1
EndIf
temp1=0
EndIf
If Button=#Button_0:ButtonIndex(0,0)=temp1:ButtonIndex(0,1)=temp2:EndIf
If Button=#Button_1:ButtonIndex(1,0)=temp1:ButtonIndex(1,1)=temp2:EndIf
If Button=#Button_2:ButtonIndex(2,0)=temp1:ButtonIndex(2,1)=temp2:EndIf
If Button=#Button_3:ButtonIndex(3,0)=temp1:ButtonIndex(3,1)=temp2:EndIf
EndProcedure
OpenWindow_Window_0()
;{- Event loop
Repeat
Event = WaitWindowEvent()
MouseOverFontChange(#Button_0,"Button_0 Hover",ButtonIndex(0,0),ButtonIndex(0,1))
MouseOverFontChange(#Button_1,"Button_1 Hover",ButtonIndex(1,0),ButtonIndex(1,1))
MouseOverFontChange(#Button_2,"Button_2 Hover",ButtonIndex(2,0),ButtonIndex(2,1))
MouseOverFontChange(#Button_3,"Button_3 Hover",ButtonIndex(3,0),ButtonIndex(3,1))