Problems with BPEEK

May 20, 2008
603
0
Sammamish, WA
SET buffer=%@BALLOC[100]
echo %buffer
echo poke %@BPOKE[%buffer,0,8,0x01020304]
echo peek %@BPEEK[%buffer,0,8]
echo free %@BFREE[%buffer]


I thought this would echo something representing 0x01020304 on the "peek"
line, but I just get 0.


TCC 11.00.52 Windows 7 [Version 6.1.7600]
TCC Build 52 Windows 7 Build 7600


TCC 12.00.30 Windows 7 [Version 6.1.7600]
TCC Build 30 Windows 7 Build 7600



--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
From: Jim Cook
| SET buffer=%@BALLOC[100]
| echo %buffer
| echo poke %@BPOKE[%buffer,0,8,0x01020304]
| echo peek %@BPEEK[%buffer,0,8]
| echo free %@BFREE[%buffer]
|
|
| I thought this would echo something representing 0x01020304 on the
| "peek"
| line, but I just get 0.

Same here. I added a "dump" of the entire buffer, and found, to my surprize, that @BALLOC does NOT initialize the buffer at all. I think that's worth mentioning in HELP page f_balloc.btm.
However, when I tried the same batch file in earlier versions, Iit also failed in V11, but worked in V10. Something must have changed btw. V10 and V11.
--
Steve
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
SET buffer=%@BALLOC[100]
echo %buffer
echo poke %@BPOKE[%buffer,0,8,0x01020304]
echo peek %@BPEEK[%buffer,0,8]
echo free %@BFREE[%buffer]

I thought this would echo something representing 0x01020304 on the "peek" line, but I just get 0.

The problem here is that you've invented a non-existent feature -- the last argument to @BPOKE should be decimal, not hex.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
---- Original Message ----
From: rconn
To: ESFabian@comcast.net
Sent: Monday, 2010. October 25. 15:17
Subject: RE: [Support-t-2365] Re: Problems with BPEEK

| Quote:
| Originally Posted by Jim Cook
| SET buffer=%@BALLOC[100]
| echo %buffer
| echo poke %@BPOKE[%buffer,0,8,0x01020304]
| echo peek %@BPEEK[%buffer,0,8]
| echo free %@BFREE[%buffer]
|
| I thought this would echo something representing 0x01020304 on the
| "peek" line, but I just get 0.
|
| The problem here is that you've invented a non-existent feature --
| the last argument to @BPOKE should be decimal, not hex.

AFAIK this is the only place in TCC where hexadecimal is not accepted where numeric value is expected.
--
Steve
 
May 20, 2008
603
0
Sammamish, WA
>
>
> The problem here is that you've invented a non-existent feature -- the last
> argument to @BPOKE should be decimal, not hex.
>
>
A slightly modified test batch here shows that 11.00.49 worked as I expected
and 11.00.52 does not. I expected it to work as it did in all the early (at
least up to 11.00.49) and version 10 (I am taking Steve's report as fact for
this).

SET buffer=%@BALLOC[100]
echo %buffer
echo poke %@BPOKE[%buffer,0,8,0x01020304]
echo peek %@BPEEK[%buffer,0,1]
echo peek %@BPEEK[%buffer,1,1]
echo peek %@BPEEK[%buffer,2,1]
echo peek %@BPEEK[%buffer,3,1]
echo free %@BFREE[%buffer]


D:\>ver

TCC 11.00.49 Windows 7 [Version 6.1.7600]

D:\>test
3ca0a80
poke 0
peek 4
peek 3
peek 2
peek 1
free 0

D:\>ver

TCC 11.00.52 Windows 7 [Version 6.1.7600]

D:\>test
23a1958
poke 0
peek 0
peek 0
peek 0
peek 0
free 0

D:\>


--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
---- Original Message ----
From: rconn
To: ESFabian@comcast.net
Sent: Monday, 2010. October 25. 15:55
Subject: RE: [Support-t-2365] Re: Problems with BPEEK

| Quote:
| Originally Posted by Steve F�bi�n
| AFAIK this is the only place in TCC where hexadecimal is not accepted
| where numeric value is expected.
| Steve
|
| Nope; there are a lot of others.
|
| But this is one of the very few that takes 64-bit input (which
| doesn't support optional hex anywhere).

I hadn't reason to test 64-b input in the past. However, as the @BPEEK and the @BPOKE functions are essentially byte-oriented, as the size field parameter clearly implies, IMHO @BPEEK should accept hexadecimal input, and @BPOKE should have the option to report its value in hexadecimal.
--
Steve
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
A slightly modified test batch here shows that 11.00.49 worked as I expected and 11.00.52 does not. I expected it to work as it did in all the early (at least up to 11.00.49) and version 10 (I am taking Steve's report as fact for this).

That (undocumented, unsupported) behavior went away when 8-byte variable support was added.

Note that the help file says nothing about hex support.
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
I hadn't reason to test 64-b input in the past. However, as the @BPEEK and the @BPOKE functions are essentially byte-oriented, as the size field parameter clearly implies, IMHO @BPEEK should accept hexadecimal input, and @BPOKE should have the option to report its value in hexadecimal.

Submit it in the Suggestions forum. It will *not* be in v12.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
----- Original Message -----
From: rconn
To: ESFabian@comcast.net
Sent: Monday, 2010. October 25. 16:44
Subject: RE: [Support-t-2365] Re: Problems with BPEEK


Quote:
Originally Posted by Steve F�bi�n
I hadn't reason to test 64-b input in the past. However, as the @BPEEK and the @BPOKE functions are essentially byte-oriented, as the size field parameter clearly implies, IMHO @BPEEK should accept hexadecimal input, and @BPOKE should have the option to report its value in hexadecimal.

Submit it in the Suggestions forum. It will *not* be in v12.
 
Similar threads
Thread starter Title Forum Replies Date
Charles S. Roaten Problems with TCSTART.BTM Support 1
vefatica Office problems better Support 0
Peter Murschall TCC V26.01.3x Debugging has problems with Alias /R Support 1
Peter Murschall CMDebug 26.01.37 has problems with Alias Support 21
C unzip problems Support 2
C TCC 26 BATCOMP BTM problems? Support 5
Alpengreis WAD [v26 Beta RC3]: MSGBOX color problems Support 4
Alpengreis QUERYBOX problems Support 5
R New Cloud Storage Tab in TCC options causing problems Support 0
Craig Fitzgerald Problems using tcstart.btm Support 3
M Problems with @REGBREAD on remote system Support 4
K_Meinhard Help problems Support 3
S Problems with dir command in the debugger Support 5
D How to? Path problems in TCC20 Support 1
G Version 20.11 installed on Windows 10 problems Support 9
M WAD Set statements in () causes problems Support 8
M Fixed Set "VAR=VAL" format causes problems Support 12
H Problems with PSUBST Support 3
Alpengreis The TCMD Display problems and font size ... Support 2
cgunhouse Problems With IFTP Support 3
Gamegod Fixed TCC identify Chinese problems Support 30
vefatica 21-22 Update problems Support 8
T Problems with the new help format Support 18
cgunhouse Event Plugin Problems With 19.10.43 Support 2
C @replace and @xreplace problems Support 5
Alpengreis Forum problems? Support 0
N Fixed Problems with SHA256/384/512 Support 5
Alpengreis [TC 19.0 Beta 22/23] Install/Update-"Problems" Support 4
P Problems registering Support 5
R Parser problems after build 44 Support 5
LowdhamStation Serial port problems Support 7
vefatica Is jpsoft.com having ISP problems? Support 10
M Problems when being logged in Support 4
vefatica Both IFTP problems remain in build 50 Support 35
vefatica IFTP problems (broken pipe?) Support 24
Joe Caverly VIEW window in a TCC tab window problems Support 5
S Forum Implementation Problems Support 2
S Forum (XenForo) problems Support 3
S Problems to create new threads Support 6
S Fixed CLIPMONITOR problems Support 9
Roedy WAD Minor long-standing install problems Support 6
E Problems with Tabbed Toolbar Support 2
S Log and foldermonitor problems Support 3
vefatica Installation problems Support 1
J Problems for a neophyte Support 30
C Active FTP Problems Support 4
J Still problems understanding "foldermonitor" Support 9
J syntax problems multiple commands (command & command) Support 4
J 4NT problems after going to Windows 7 Support 5
vefatica Installer problems Support 23

Similar threads