"^Line too long" error when making EXE

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Anonymous

"^Line too long" error when making EXE

Post by Anonymous »

Whenever I try to make an exe of my game engine i just started, i get this...

BC D:\PROGRA~1\QBASIC\TEST.BAS/O/T/C:512;
Microsoft (R) QuickBASIC Compiler Version 4.50
(C) Copyright Microsoft Corporation 1982-1988.
All rights reserved.
Simultaneously published in the U.S. and Canada.
062B 05E0
^ Line too long

42957 Bytes Available
38825 Bytes Free

0 Warning Error(s)
1 Severe Error(s)

So how am I able to fix this? I don't know ASM so I don't know what line is too long or even if that is a literal error, I am VERY lost and confused. All it is is just one .bas file I am compiling, and it uses no external files and doesn't load or save any external files. :? please help me out
MystikShadows
Veteran
Posts: 703
Joined: Sun Nov 14, 2004 7:36 am
Contact:

Post by MystikShadows »

one of those lines must be longer than 512 characters...

perhaps if you post the code, we'll be able to pinpoint it.
When God created light, so too was born, the first Shadow!

MystikShadows

Need hosting? http://www.jc-hosting.net

Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
Anonymous

Post by Anonymous »

do u mean that one line has 512 characters going horizontally across? because i checked ALL of my lines and none of them go near that

And what is the easiest way to my post all my code?
MystikShadows
Veteran
Posts: 703
Joined: Sun Nov 14, 2004 7:36 am
Contact:

Post by MystikShadows »

put it in a message here, with the code tags

[ code ] [ /code ] <- without the spaces
When God created light, so too was born, the first Shadow!

MystikShadows

Need hosting? http://www.jc-hosting.net

Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
Anonymous

Post by Anonymous »

My program is too long to do that, for some reason i can't copy it. But why will the ^line too long message pop up? and can i use the ASM part of the message to pinpoint where the error is?
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

CCC wrote:My program is too long to do that, for some reason i can't copy it. But why will the ^line too long message pop up? and can i use the ASM part of the message to pinpoint where the error is?
What editor did you you use to create your source code?

I have a feeling that the lines of your source code ARE NOT terminated by CRLF (Carriage Return and Line Feed). If this is true, the QB45 compiler goes nuts and craps out after 512 bytes without seeing a CRLF.

If you have a hex editor, you can view your source file in hex and see what terminates each line of code.

Let us know about this, so we can help you with this problem.

*****
If you are ahead of me, lead.
If you are behind me, follow.
If you are not doing anything,
Get out of the way.
Anonymous

Post by Anonymous »

Ok, well i have a hex editor, i DON'T understand anything about hex or assembler, and i dont know what you mean by where it terminates. Could i send you the .bas maybe?
User avatar
Stoves
Veteran
Posts: 101
Joined: Fri Feb 10, 2006 12:24 am
Location: Nashville, TN

Save as Text

Post by Stoves »

If you save your program in text format from the qb interpreter (Save As...->Select Format Txt), any text editor will be able to open the .bas file. Then you should be able to copy and paste your code into a forum post.
Anonymous

Post by Anonymous »

Heres the code, it's complete crap and i really need to sort it out into something i can use easily.....

Code: Select all

DEFINT A-Z
SCREEN 13
CLS
COLOR 4
FOR F = 1 TO 6000
RANDOMIZE TIMER
fx = INT(RND * 150) + 1
ffx = INT(RND * 200) + 1
fffx = INT(RND * 320) + 1
fy = INT(RND * 50) + 1
ffy = INT(RND * 100) + 1
fffy = INT(RND * 200) + 1
PSET (fx + 80, fy + 55), 4
PSET (ffx + 55, ffy + 30), 42
PSET (fffx, fffy), 14
LOCATE 9, 18
PRINT "WimF"
LOCATE 12, 12
PRINT "Where is my Face?"
NEXT F
SLEEP 2
CLS

COLOR 2

RESTORE world
              
CONST ACROSS = 11
CONST DOWN = 11

DIM blankimg(116)
DIM grassimg(116)
DIM treeimg(116)
DIM playerimg(116)
DIM Building(116)
DIM start(116)
DIM playerimgup(116)
DIM playerimgleft(116)
DIM playerimgright(116)

READ tacross, tdown

TYPE tiletype
x AS INTEGER
y AS INTEGER
style AS INTEGER
END TYPE

DIM tile(tacross, tdown) AS tiletype

TYPE playertype  'create a type called playertype
x AS INTEGER 'x tile where the player is
y AS INTEGER 'y tile where the player is
px AS INTEGER 'the players "permanant" x tile, the tile that he appears
'in out of the tiles on the screen
py AS INTEGER 'the players "permanant" y tile
END TYPE

DIM player AS playertype
            
READ player.x, player.y  'read player x and y coords from data block "world"
player.px = 6
player.py = 6

DEF FNSetlocs    'function to set pixel locs of tiles that appear on screen
FOR A = 1 TO ACROSS
FOR j = 1 TO DOWN
tile(A, j).x = 15 * A  'set pixel x location of tile
tile(A, j).y = 15 * j  'set pixel y location of tile
NEXT j                    '(all tiles are 15x15 pixels)
NEXT A
END DEF

DEF FNSetAtts   'function to read the styles of all tiles from data block
FOR d = 1 TO tdown
FOR A = 1 TO tacross
READ tile(A, d).style 'read the tile's style
NEXT A
NEXT d
END DEF


DEF FNDrawTile (tx, ty, cx, cy)
SELECT CASE tile(tx, ty).style  'check the tile's style
CASE 0  'if it's 0, draw an array of zero's (a black tile)
PUT (tile(cx, cy).x, tile(cx, cy).y), blankimg, PSET
CASE 1  'if it's 1, draw the grass tile                                                                                                                                                                                                              
PUT (tile(cx, cy).x, tile(cx, cy).y), grassimg, PSET
CASE 2  'if it's 2, draw the tree tile
PUT (tile(cx, cy).x, tile(cx, cy).y), treeimg, PSET
CASE 3
PUT (tile(cx, cy).x, tile(cx, cy).y), Building, PSET
CASE -1
PUT (tile(cx, cy).x, tile(cx, cy).y), start, PSET
END SELECT
END DEF



'this draws all the visible tiles on the screen
'it will draw from 5 tiles to the left of the player to 5 tiles to his right
'and from 5 tiles up to 5 tiles down
DEF FNDrawScreen
FOR rela = -5 TO 5
FOR reld = -5 TO 5
dummy = FNDrawTile(player.x + rela, player.y + reld, player.px + rela, player.py + reld)
NEXT reld
NEXT rela
END DEF

'this function draws the player on the screen in his "permanant" location
DEF FNDrawPlayer
PUT (tile(player.px, player.py).x, tile(player.px, player.py).y), playerimg, PSET
END DEF


DEF FNDrawPlayerup
PUT (tile(player.px, player.py).x, tile(player.px, player.py).y), playerimgup, PSET
END DEF

DEF FNDrawPlayerleft
PUT (tile(player.px, player.py).x, tile(player.px, player.py).y), playerimgleft, PSET
END DEF

DEF FNDrawPlayerright
PUT (tile(player.px, player.py).x, tile(player.px, player.py).y), playerimgright, PSET
END DEF

DEF FNDisplayimg 'this function will read an images colors from a data block
'and display the image on the screen. Before calling this
'function, reset the data pointer to the beginning of the
'data block for the image.
FOR dp = 1 TO 15
FOR ap = 1 TO 15
READ att                     'read the value at the point in the data block
PSET (ap + 10, dp + 10), att 'put the pixel on the screen with the
'color that was read from the data
'block
NEXT ap
NEXT dp
END DEF

'* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' * * * * * * * * * * * * End of Function Defs* * * * * * * * * * * * * *

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
dummy = FNSetlocs   'set the locations for the on-screen tiles
dummy = FNSetAtts   'set the styles for all the tiles

GET (11, 11)-(25, 25), blankimg

RESTORE grassdata   'restore the data pointer to the beginning of the data
dummy = FNDisplayimg  'call routine to read and display the image
GET (11, 11)-(25, 25), grassimg 'get the image into array "grassimg"
PUT (11, 11), grassimg, XOR     'put image over existing one to clear it

RESTORE treedata 'restore data pointer to beginning of the tree tile's image
dummy = FNDisplayimg 'read and display the image
GET (11, 11)-(25, 25), treeimg  'get the image into array "treeimg"
PUT (11, 11), treeimg, XOR  'put image on top of the old one to clear it

RESTORE playerdata 'restore pointer to beginning of player tile's image
dummy = FNDisplayimg 'read and display the image
GET (11, 11)-(25, 25), playerimg  'get the image into array "playerimg"
PUT (11, 11), playerimg, XOR  'put image on top of the old one to clear it

RESTORE Building
dummy = FNDisplayimg
GET (11, 11)-(25, 25), Building
PUT (11, 11), Building, XOR

RESTORE start
dummy = FNDisplayimg
GET (11, 11)-(25, 25), start
PUT (11, 11), start, XOR

RESTORE playerdataup
dummy = FNDisplayimg
GET (11, 11)-(25, 25), playerimgup
PUT (11, 11), playerimgup, XOR

RESTORE playerdataleft
dummy = FNDisplayimg
GET (11, 11)-(25, 25), playerimgleft
PUT (11, 11), playerimgleft, XOR

RESTORE playerdataright
dummy = FNDisplayimg
GET (11, 11)-(25, 25), playerimgright
PUT (11, 11), playerimgright, XOR


dummy = FNDrawPlayer  'draw the player once

LOCATE 1, 1
PRINT "You have woken up in a strange jungle..."
LOCATE 3, 1
PRINT "All around you are plants and animals   "
LOCATE 4, 1
PRINT "you have never seen before...           "
LOCATE 6, 1
PRINT "But worse yet, you have no face!        "
SLEEP 11
CLS
dummy = FNDrawScreen  'draw the screen once
dummy = FNDrawPlayer


DO



kbd$ = INKEY$            'get a "transparent" input

IF kbd$ <> "" THEN       'if there actually was a user input, then...
kbd$ = RIGHT$(kbd$, 1) 'get the first byte of the input (this is needed
'if you want to look for input from the cursor
'keys)
SELECT CASE kbd$
CASE CHR$(27)    'user pressed escape key
END          'end the program
CASE CHR$(72) 'user pressed up arrow
IF tile(player.x, player.y - 1).style <> 2 THEN

IF player.y - 1 > 5 THEN     'make sure he doesn't go past
player.y = player.y - 1    'decrease player y tile by one
END IF
dummy = FNDrawScreen       'draw the screen
dummy = FNDrawPlayerup       'put the player on the screen
END IF
CASE CHR$(80) 'user pressed down arrow
IF tile(player.x, player.y + 1).style < 2 THEN

IF player.y + 1 < (tdown - 5) THEN 'keep player on screen
player.y = player.y + 1    'increase player y tile by one
END IF
dummy = FNDrawScreen       'draw the screen
dummy = FNDrawPlayer       'put the player on the screen
END IF
CASE CHR$(75) 'user pressed left arrow
IF tile(player.x - 1, player.y).style < 2 THEN

IF player.x - 1 > 5 THEN   'keep player on screen
player.x = player.x - 1    'decrease player x tile by one
END IF
dummy = FNDrawScreen       'draw the screen
dummy = FNDrawPlayerleft       'put the player on the screen
END IF
CASE CHR$(77) 'user pressed right arrow
IF tile(player.x + 1, player.y).style < 2 THEN

IF player.x < (tacross - 6) THEN  'keep player on screen
player.x = player.x + 1    'increase player x tile by one
END IF
dummy = FNDrawScreen       'draw the screen
dummy = FNDrawPlayerright       'put the player on the screen
END IF
END SELECT
END IF

IF player.x = 6 AND player.y = 6 THEN GOSUB hut66
IF player.x = 23 AND player.y = 23 THEN GOSUB hut2323
IF player.x = 15 AND player.y = 16 THEN GOSUB bed
LOOP

bed:
CLS
PRINT "YOU ARE IN BED"
PRINT
PRINT
PRINT "Would you like to [Q]uit?"
PRINT
PRINT "Would you like to go to [S]leep?"
PRINT
PRINT "Would you like to get [O]ut of bed?"
DO
SELECT CASE INKEY$
CASE "q"
END
CASE "s"
CLS
PRINT "ZZZZZ ZZZZ ZZZ ZZ Z  Z   Z     Z"
SLEEP 5
CLS
player.y = player.y - 1
dummy = FNDrawScreen
dummy = FNDrawPlayerup
RETURN
CASE "o"
CLS
player.y = player.y - 1
dummy = FNDrawScreen
dummy = FNDrawPlayerup
RETURN
END SELECT
LOOP


hut66:
CLS
PRINT
PRINT "      Hello, welcome to my hut."
PRINT "           My name is Jeb."
player.y = player.y + 1
LINE (100, 60)-(180, 160), 6, BF
LINE (95, 90)-(185, 100), 6, BF
LINE (100, 55)-(180, 70), 14, BF
LINE (120, 50)-(160, 55), 14, BF
LINE (110, 100)-(125, 115), 15, BF
LINE (170, 100)-(155, 115), 15, BF
LINE (120, 115)-(115, 105), 0, BF
LINE (160, 115)-(165, 105), 0, BF
LINE (105, 90)-(130, 95), 14, BF
LINE (175, 90)-(150, 95), 14, BF
LINE (115, 135)-(165, 145), 15, BF
LINE (115, 140)-(165, 140), 0, BF
LINE (135, 112)-(130, 130), 0
LINE (145, 112)-(150, 130), 0
CIRCLE (133, 130), 3, 0
CIRCLE (147, 130), 3, 0
PAINT (133, 130), 0
PAINT (147, 130), 0
SLEEP 5
CLS
dummy = FNDrawScreen
dummy = FNDrawPlayer
RETURN

hut2323:
CLS
PRINT
PRINT "      How dare you disturb me!"
player.y = player.y + 1
LINE (100, 60)-(180, 160), 6, BF
LINE (95, 90)-(185, 100), 6, BF
LINE (100, 55)-(180, 70), 161, BF
LINE (120, 50)-(160, 55), 161, BF
LINE (110, 100)-(125, 115), 15, BF
LINE (170, 100)-(155, 115), 15, BF
LINE (120, 115)-(115, 105), 4, BF
LINE (160, 115)-(165, 105), 4, BF
LINE (105, 90)-(130, 95), 161, BF
LINE (175, 90)-(150, 95), 161, BF
LINE (130, 140)-(150, 140), 0, BF
LINE (135, 112)-(130, 130), 0
LINE (145, 112)-(150, 130), 0
CIRCLE (133, 130), 3, 0
CIRCLE (147, 130), 3, 0
PAINT (133, 130), 0
PAINT (147, 130), 0
SLEEP 3
CLS
dummy = FNDrawScreen
dummy = FNDrawPlayer
RETURN

world:
DATA 30,30
DATA 15,15
DATA 1,2,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,1,2,1,1,1,1
DATA 1,1,1,2,1,1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,2,1,1,1,1,1,2,1,1
DATA 1,1,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1,2
DATA 1,2,1,1,1,1,2,1,1,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1
DATA 1,1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,2,2,2,2,2,2,2,2,1,1,1,2,1,1
DATA 1,1,2,1,2,3,1,1,1,2,1,1,1,1,2,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1
DATA 2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,2,1
DATA 1,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1
DATA 1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,2,1,1,1,1,1
DATA 1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,1,1
DATA 1,2,1,1,1,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,2,1,1,1,2,1
DATA 1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,1,1
DATA 1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1
DATA 1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,1,1,2,1,2,1,1,1,1
DATA 1,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,1,1
DATA 2,1,1,1,2,1,1,1,1,1,1,1,1,1,-1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1
DATA 1,1,1,1,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,2
DATA 1,1,2,1,2,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,2,2,1,1,1,1,2,1
DATA 1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,2,1,1,1
DATA 1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1
DATA 1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,2,1,1
DATA 2,1,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1
DATA 1,2,1,1,1,2,2,1,1,1,1,1,1,1,1,2,2,2,2,1,1,1,3,1,2,1,1,1,1,1
DATA 1,1,1,2,1,1,2,1,1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,2,1,1,2,1,1
DATA 1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,1,1,1,1,2,2,2,2,2,2,1,1,1,1
DATA 1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2
DATA 1,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1
DATA 2,1,1,1,1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1
DATA 1,1,1,1,2,1,1,1,1,2,1,1,1,1,1,1,1,1,2,1,1,1,1,2,1,1,1,1,1,1
DATA 1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,2,1,1

grassdata:
DATA 192,192,192,192,192,192,192,192,148,192,192,145,192,192,192
DATA 192,2,192,192,192,192,192,192,192,192,192,192,192,192,141
DATA 192,192,192,192,142,192,192,2,192,192,192,192,192,192,192
DATA 192,192,192,192,192,192,192,192,192,192,192,192,2,192,192
DATA 192,2,192,2,192,145,192,192,192,142,192,192,192,192,192
DATA 192,192,192,192,192,192,192,192,2,192,192,192,192,192,2
DATA 192,192,192,142,192,192,192,192,192,192,192,2,192,192,192
DATA 192,2,192,192,192,142,192,192,192,192,192,192,192,192,192
DATA 192,192,192,192,192,192,192,192,192,2,192,192,147,192,192
DATA 192,142,192,192,192,192,192,192,192,192,192,192,192,192,192
DATA 192,192,192,2,192,192,142,192,192,2,192,192,192,2,192
DATA 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192
DATA 2,192,192,192,192,145,192,2,192,192,192,192,2,192,192
DATA 192,192,192,2,192,192,192,192,192,192,192,192,192,192,142
DATA 145,192,192,192,147,192,192,192,2,192,192,2,192,192,192

treedata:
DATA 192,2,192,192,192,2,2,2,192,192,192,192,192,2,192
DATA 192,192,192,2,2,2,2,2,2,2,192,192,192,192,192
DATA 147,192,2,2,2,2,2,2,2,2,2,147,192,192,192
DATA 192,2,2,2,2,2,2,2,2,2,2,2,192,192,192
DATA 192,2,2,2,2,2,2,2,2,2,2,2,192,192,192
DATA 192,2,2,2,2,2,2,2,2,2,2,2,192,192,192
DATA 192,2,2,2,2,2,2,2,2,2,2,2,147,192,192
DATA 192,192,2,2,2,2,2,2,2,2,2,192,192,192,192
DATA 192,192,192,2,2,2,2,2,2,2,192,192,145,192,192
DATA 192,192,192,192,192,6,6,6,192,192,192,192,192,2,192
DATA 192,192,192,192,192,6,6,6,192,192,192,192,192,192,192
DATA 192,147,192,192,192,6,6,6,192,192,192,192,192,192,192
DATA 2,192,192,192,192,6,6,6,192,192,192,192,192,192,192
DATA 192,192,192,192,6,6,6,6,6,192,192,192,192,192,147
DATA 147,192,145,192,192,192,192,147,192,192,192,192,2,192,192

playerdata:
DATA 192,192,192,192,192,192,14,14,14,192,192,192,192,192,192
DATA 192,2,192,192,192,192,65,65,65,192,192,192,192,192,192
DATA 192,192,147,192,192,192,65,65,65,192,192,2,192,192,192
DATA 192,192,192,192,192,192,65,65,65,192,192,147,192,192,192
DATA 192,192,2,192,192,192,192,65,192,192,192,192,192,192,192
DATA 192,192,192,192,145,192,8,8,8,192,192,192,192,192,192
DATA 192,192,192,192,192,8,8,8,8,8,192,192,2,192,192
DATA 192,192,192,192,8,8,2,8,192,8,8,192,192,192,147
DATA 192,192,147,192,65,192,192,8,192,192,65,192,192,192,192
DATA 192,192,192,192,192,192,192,8,192,192,192,192,192,192,192
DATA 145,192,2,192,192,192,1,1,1,2,192,192,192,192,192
DATA 192,192,192,192,192,192,1,192,1,192,192,192,192,192,192
DATA 192,192,192,192,147,192,1,192,1,192,192,192,192,192,147
DATA 192,192,192,192,192,192,1,192,1,192,192,192,192,2,192
DATA 192,192,192,2,192,192,1,192,1,192,192,192,192,192,192


Building:
DATA 192,192,192,192,192,192,192,6,192,192,192,192,192,192,192
DATA 192,192,192,192,192,192,6,14,6,192,192,192,192,192,192
DATA 192,192,192,192,192,6,14,14,14,6,192,192,192,192,192
DATA 192,192,192,192,6,6,6,6,6,6,6,192,192,192,192
DATA 192,192,192,6,6,6,6,6,6,6,6,6,192,192,192
DATA 192,192,6,6,6,6,6,0,6,6,6,6,6,192,192
DATA 192,6,6,6,6,6,0,0,0,6,6,6,6,6,192
DATA 192,6,14,14,6,0,0,0,0,0,6,14,14,6,192
DATA 192,6,6,6,6,0,0,0,0,0,6,6,6,6,192
DATA 192,6,6,6,6,0,0,0,0,0,6,6,6,6,192
DATA 192,6,6,14,6,0,0,0,0,0,6,14,6,6,192
DATA 192,6,6,14,6,0,0,0,0,0,6,14,6,6,192
DATA 192,6,6,14,6,0,0,0,0,0,6,14,6,6,192
DATA 192,6,6,6,6,0,0,0,0,0,6,6,6,6,192
DATA 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192

start:
DATA 192,6,6,6,6,6,6,6,6,6,6,6,6,6,192
DATA 192,6,12,12,12,12,12,12,12,12,12,12,12,6,192
DATA 192,6,12,12,12,12,12,12,12,12,12,12,12,6,192
DATA 192,6,12,12,12,12,12,12,12,12,12,12,12,6,192
DATA 192,6,12,12,12,12,12,12,12,12,12,12,12,6,192
DATA 192,6,12,12,12,12,12,12,12,12,12,12,12,6,192
DATA 192,6,12,12,12,12,12,12,12,12,12,12,12,6,192
DATA 192,6,15,15,15,15,15,6,15,15,15,15,15,6,192
DATA 192,6,15,15,15,6,6,6,6,6,15,15,15,6,192
DATA 192,6,6,6,6,6,6,6,6,6,6,6,6,6,192
DATA 192,6,6,6,6,6,6,6,6,6,6,6,6,6,192
DATA 192,6,6,6,6,6,6,6,6,6,6,6,6,6,192
DATA 192,6,192,192,192,192,192,192,192,192,192,192,192,6,192
DATA 192,6,192,192,192,192,192,192,192,192,192,192,192,6,192
DATA 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192

playerdataup: 
DATA 192,192,192,192,192,192,14,14,14,192,192,192,192,192,192
DATA 192,2,192,192,192,192,14,14,14,192,192,192,192,192,192
DATA 192,192,147,192,192,192,14,14,14,192,192,2,192,192,192
DATA 192,192,192,192,192,192,65,14,65,192,192,147,192,192,192
DATA 192,192,2,192,192,192,192,65,192,192,192,192,192,192,192
DATA 192,192,192,192,145,192,8,8,8,192,192,192,192,192,192
DATA 192,192,192,192,192,8,8,8,8,8,192,192,2,192,192
DATA 192,192,192,192,8,8,2,8,192,8,8,192,192,192,147
DATA 192,192,147,192,65,192,192,8,192,192,65,192,192,192,192
DATA 192,192,192,192,192,192,192,8,192,192,192,192,192,192,192
DATA 145,192,2,192,192,192,1,1,1,2,192,192,192,192,192
DATA 192,192,192,192,192,192,1,192,1,192,192,192,192,192,192
DATA 192,192,192,192,147,192,1,192,1,192,192,192,192,192,147
DATA 192,192,192,192,192,192,1,192,1,192,192,192,192,2,192
DATA 192,192,192,2,192,192,1,192,1,192,192,192,192,192,192

playerdataleft:
DATA 192,192,192,192,192,192,14,14,14,192,192,192,192,192,192
DATA 192,2,192,192,192,192,65,14,14,192,192,192,192,192,192
DATA 192,192,147,192,192,192,65,14,14,192,192,2,192,192,192
DATA 192,192,192,192,192,192,65,65,14,192,192,147,192,192,192
DATA 192,192,2,192,192,192,192,65,192,192,192,192,192,192,192
DATA 192,192,192,192,145,192,8,8,192,192,192,192,192,192,192
DATA 192,192,192,192,192,192,8,8,192,192,192,192,2,192,192
DATA 192,192,192,192,192,192,8,8,192,192,192,192,192,192,147
DATA 192,192,147,192,192,192,8,8,192,192,192,192,192,192,192
DATA 192,192,192,192,192,192,65,8,192,192,192,192,192,192,192
DATA 145,192,2,192,192,192,1,1,192,2,192,192,192,192,192
DATA 192,192,192,192,192,192,1,1,192,192,192,192,192,192,192
DATA 192,192,192,192,147,192,1,1,192,192,192,192,192,192,147
DATA 192,192,192,192,192,192,1,1,192,192,192,192,192,2,192
DATA 192,192,192,2,192,192,1,1,192,192,192,192,192,192,192

playerdataright:
DATA 192,192,192,192,192,192,14,14,14,192,192,192,192,192,192
DATA 192,2,192,192,192,192,14,14,65,192,192,192,192,192,192
DATA 192,192,147,192,192,192,14,14,65,192,192,2,192,192,192
DATA 192,192,192,192,192,192,14,65,65,192,192,147,192,192,192
DATA 192,192,2,192,192,192,192,65,192,192,192,192,192,192,192
DATA 192,192,192,192,145,192,192,8,8,192,192,192,192,192,192
DATA 192,192,192,192,192,192,192,8,8,192,192,192,2,192,192
DATA 192,192,192,192,192,192,192,8,8,192,192,192,192,192,147
DATA 192,192,147,192,192,192,192,8,8,192,192,192,192,192,192
DATA 192,192,192,192,192,192,192,8,65,192,192,192,192,192,192
DATA 145,192,2,192,192,192,192,1,1,2,192,192,192,192,192
DATA 192,192,192,192,192,192,192,1,1,192,192,192,192,192,192
DATA 192,192,192,192,147,192,192,1,1,192,192,192,192,192,147
DATA 192,192,192,192,192,192,192,1,1,192,192,192,192,2,192
DATA 192,192,192,2,192,192,192,1,1,192,192,192,192,192,192
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

CCC wrote:Ok, well i have a hex editor, i DON'T understand anything about hex or assembler, and i dont know what you mean by where it terminates. Could i send you the .bas maybe?
Yes, send me the .bas, but first make a copy of it to another file with .TXT instead of .BAS, otherwise the email system won't allow it. Send to:
EdwardMoneo@gmail.com

Regarding viewing a file with a hex editor.
When you view a file with a TEXT editor you only see the actual text, without the "hidden" characters (terminators) at the end of each text line.

When you view the same text file with a HEX editor, you will see the hexadecimal representation of each character, and also the characters that terminate each line.

For example:
If you have the following line created by a normal text editor, and you terminated the line with <Enter>, you will see this:
ABC=1

The same line, viewed with a hex edit will look like this:
41 42 43 3D 31 0D 0A
where
41 is A, 42 is B, 43 is C, 3D is =, 31 is 1
and 0D 0A are the terminators Carriage Return and Line Feed (CRLF).

If you notice that your lines do not end with CRLF characters, then you were not using a normal text editor, like maybe a Unix editor. Some clever software will detect and allow different line terminators, but I'm sure that the QB45 compiler won't.

So, send me a .txt copy of your original .bas, so I can take a look at what you actually fed the QB45 compiler.

Regards..... Moneo
Bulldog
Newbie
Posts: 7
Joined: Wed Aug 09, 2006 9:30 am

hope I'm not buttin in here but

Post by Bulldog »

Since nobody has replied since yesterday... It looks like line 87 and line 146 are the cause of your problem. I just did somthin like

OPEN "tst1.bas" FOR INPUT AS #1
DO
LINE INPUT #1, ab$
cntr% = cntr% + 1
PRINT cntr%; " "; LEN(ab$)
SLEEP
LOOP WHILE NOT EOF(1)

line 87 is 244 bytes long and line 146 is 489 bytes long
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

Bulldog,

Excuse the expression, but "you're barking up the wrong tree."

If you copy/pasted CCC's code from the post above, God knows what line terminators you got. The lines you mention are not too long when viewed with a hex editor. In reality, the longest line is 77 bytes long.

CCC mailed me the original source file which I examined with a hex editor. Sure enough, every line was terminated by a Linefeed only.

I also have the QuickBasic 4.5 compiler, and tried compiling the code as is. I didn't get a "line too long" error message, but got 4 other errors on lines that look perfectly good. Could be because CCC uses different compile switches than I do. Anyway, we can conclude that the compiler doesn't like source code lines terminated by Linefeed only.

Then I got an idea and loaded the source file into EDIT. Then I saved the source to another file. Looking at the second file with the hex editor, all the Linefeeds were converted to Carriage-Return and LineFeed.

Then I compiled this second file and got 4 legitimate coding errors. I emailed this second file back to CCC earlier today for him to fix the errors.

I still don't know what CCC used to create his source file with Linefeed only line terminators. I have a feeling that this source file was retrieved from some kind of backup, or maybe a print file, or from some Internet media.

Regards..... Moneo
Bulldog
Newbie
Posts: 7
Joined: Wed Aug 09, 2006 9:30 am

Post by Bulldog »

Well I did copy and paste the code from above and qb45 gave me a line too long error, after fixing those 2 lines it compiled fine using make exe from the pulldown menus. As a mater of fact if you highlite the code above you can see that there are several lines that are nothing but spaces. At any rate he is up and running now that's all that matters.
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Post by Patz QuickBASIC Creations »

He was using a UNIX/Linux editor.

Source: http://members.aol.com/getmydata/pskb/T ... Format.htm

Windows and DOS are terminated by both a Carriage Return and Line Feed.
UNIX/Linux text editors terminate using a Line Feed.
And, MACs terminate using a Carriage Return.


Problems like this are the reason the GNU GPL and the software that abides by it exist. Microsoft feels that they define what is 'standard', so they can do things how ever they want. But, in my text editor (Kate - the KDE Adanced Text Editor) you can choose how you want your lines terminated. I usually choose DOS/Windows encoding, since
PQBC, just a minute ago, wrote:Microsoft feels that they define what is 'standard', so they can do things how ever they want.
It is the most widely supported method of encoding, though. I have loaded the same text file with the Carriage Return and Line Feeds successfully on MAC, Linux, Windows, DOS, etc.

But that's just me ranting again...
moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Post by moneo »

Patz,

Nice detective work, and thanks for the background information.

I suspected that his file was created with a Unix-type editor based on finding only Linefeeds.

What's even worse is a report file generated on a Unix system. These files can have all kinds of line terminators, LF only, CRLF, FormFeeds, and combinations and multiples of these. Ten years ago, I had to write a utility program in C to convert these report files to have only CRLF's in order to be able to process them in Windows.

Actually, the "standard" of CRLF line terminators was not developed by Microsoft, but way before they were founded. This standard dates back to the old mechanical typewriters. I'm sure you've seen one somewhere. Well, they had a bar sticking out from the top of the carriage. You could reposition the carriage at the first print position by pushing on this bar and positioning it on the far left. This was the CARIAGE-RETURN operation. If you also gave the bar an extra push at the end, it advanced the paper one line. This was the LINE-FEED operation. So, when you finished typing a line, you pushed the bar with an extra push at the end, and it positioned you in the first position of the next line --- CARRIAGE-RETURN LINE-FEED operation. That's where the standard comes from.

On these old typwriters, you could type a line, do a CARRIAGE-RETURN only, and underline all or parts of the original line. If you were putting stuff into a column, you could use the LINE-FEED only to advance to the same position on subsequent lines.

Not such a dumn standard.

The guys a Bell Labs, who invented Unix, wanted to improve on the standard saving one terminator character per line. They were as clever as the guys who used 2 digit years in their dates to save the 2 century digits, later causing all the Year 2000 problems.

Regards..... Moneo
Post Reply