----boundary-LibPST-iamunique-201407322_-_-
Content-type: text/plain
Hello Blackbox Users,
when I tried to use WinApi.GetUsername I found a strange behavior which I can not explain.
The two versions of Procedure Run of the module TestWin differ only in a superfluous local
variable h: SHORTINT in the second version but the result is different.
I suppose that the effect comes from the untagged array in the WinApi procedure which I don't
use the right way. But what would be correct?
For your help, thanks in advance.
Gerhard Marent
E-Mail: gerhard.marent{([at]})nowhere.xy
MODULE TestWin;
IMPORT SYSTEM, Strings, WinApi, Out, Dialog;
PROCEDURE Run1*;
VAR str0: ARRAY [untagged] 40 OF SHORTCHAR; str: Dialog.String; size, i: INTEGER;
BEGIN
str0 := "";
IF WinApi.GetUserName (str0, size) # 0 THEN
FOR i := 0 TO size DO str[i] := LONG(str0[i]); END;
Out.String(str); Out.Ln;
ELSE
Dialog.Beep; Dialog.ShowMsg("User Name Error");
END;
END Run1;
PROCEDURE Run2*;
VAR str0: ARRAY [untagged] 40 OF SHORTCHAR; str: Dialog.String; h: SHORTINT; size, i: INTEGER;
BEGIN
str0 := "";
IF WinApi.GetUserName (str0, size) # 0 THEN
FOR i := 0 TO size DO str[i] := LONG(str0[i]); END;
Out.String(str); Out.Ln;
ELSE
Dialog.Beep; Dialog.ShowMsg("User Name Error");
END;
END Run2;
END TestWin.
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
blackbox-request{([at]})nowhere.xy
To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
owner-blackbox{([at]})nowhere.xy
Current posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-201407322_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5z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ZW0gcmVwb3J0cyBvciBxdWVzdGlvbnMgcmVs
YXRlZCB0byB0aGlzIGVtYWlsIGxpc3QgdG8gdGhlIGxpc3Qgb3duZXIgYXRccGFyDQogICBvd25l
ci1ibGFja2JveEBvYmVyb24uY2hccGFyDQpccGFyDQpDdXJyZW50IHBvc3RpbmcgcG9saWN5Olxw
YXINClxwYXINCmEpIFRvIHBvc3QgeW91IHNob3VsZCB1c2UgdGhlIHNhbWUgYWRkcmVzcyBieSB3
aGljaCB5b3UgYXJlIHN1YnNjcmliZWQgdG8gdGhlIG1haWxpbmcgbGlzdC4gVGhhdCB3YXksIHRo
ZSBsaXN0IHNlcnZlciB3aWxsIHJlY29nbml6ZSB5b3UgYXMgc3Vic2NyaWJlciBhbmQgZm9yd2Fy
ZCB5b3VyIHBvc3RpbmcgaW1tZWRpYXRlbHksIHdpdGhvdXQgY3JlYXRpbmcgYW55IG92ZXJoZWFk
LlxwYXINClxwYXINCmIpIElmLCBmb3Igc29tZSByZWFzb24sIHlvdSBjYW5ub3QgcG9zdCBmcm9t
IHRoZSBhZGRyZXNzLCBieSB3aGljaCB5b3UgYXJlIHN1YnNjcmliZWQsIHlvdXIgbWVzc2FnZSB3
aWxsIGJlIG1vZGVyYXRlZCB0byBhdm9pZCBzcGFtLiBQbGVhc2UgdW5kZXJzdGFuZCB0aGF0IG1v
ZGVyYXRpb24gd2lsbCBvZnRlbiBjYXVzZSBzb21lIGRlbGF5LCBpbiBwYXJ0aWN1bGFyIG92ZXIg
d2Vla2VuZHMgb3IgaG9seWRheX19ACBSdW4gbw=
----boundary-LibPST-iamunique-201407322_-_---
Received on Tue May 20 2003 - 16:34:55 UTC
This archive was generated by hypermail 2.3.0
: Thu Sep 26 2013 - 06:29:14 UTC