Using Escape Character HELP!

Previous topic - Next topic

spicypixel

I had some issues before with \ in strings which I was informed were due to escape codes. With this in mind I am now trying to use these escape codes to my benefit and I am hitting an error with this specific code, can anyone give any information as to what is causing this issue.

Code (glbasic) Select
html_pos% = INSTR(html$, "<h2 class=\"item sell\"><a class=\"permalink\" href=\"http://www.domain.co.uk/folder/", 0)

I get the error

Code (glbasic) Select
C:\Users\Win7\AppData\Local\Temp\glbasic\gpc_temp1.cpp: In function `DGInt __GLBASIC__::Menu()':
C:\Users\Win7\AppData\Local\Temp\glbasic\gpc_temp1.cpp:437: error: expected `)' before ';' token
*** FATAL ERROR - Please post this output in the forum
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

kanonet

you found an interesting bug(?) there, but this workaround should help you:
Code (glbasic) Select
LOCAL a$="<h2 class=\"item sell\"><a class=\"permalink\" href=\"http://www.domain.co.uk/folder/"
html_pos% = INSTR(html$, a$, 0)


Some more demonstrations of this bug:
Works:
Code (glbasic) Select
b$="a\"b//"
pos = INSTR(a$, b$, 0)


Works not:
Code (glbasic) Select
pos% = INSTR(a$, "a\"b//", 0)

Works:
Code (glbasic) Select
LOCAL pos% = INSTR(a$, "a\"b//", 0)

The last one is really weird. I dont know if this is related to the V11 string problems that i already reported. All testing done with V11.171
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

spicypixel

I'm using 10.283 so it's not a v11 issue.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

spicypixel

Can someone move this to BUGs thread please :)
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

MrTAToad

Hopefully Ian or someone will do soon!

Ian Price

I came. I saw. I played.