home *** CD-ROM | disk | FTP | other *** search
- all
- H#: 54813 S12/SPECTRA Publishing
- 02-Jul-90 20:34:19
- Sb: #54681-DIM errors
- Fm: Dan Robins 70007,3264
- To: Bob Zale: PowerBASIC R&D 76304,1303 (X)
-
- Bob,
- Have you experienced anyone else mentioning certain string arrays (of the
- non-flex variety) being replaced by chr$(32) when performing an ARRAY DELETE
- command?
- Read strange. Early in a program I do READ statements to find out the
- filename & record size, dependent upon a menu selection, ie:
- SELECT CASE menuselect%
- CASE 1
- RESTORE CustomerDat
- CASE 2
- RESTORE ProductDat
- CASE 3
- RESTORE InvoiceDat
- END SELECT
- READ filename$:READ filelength%
- RETURN
- 'at the bottom of the program are the Data statements
- CustomerDat:
- DATA "CUSTOMER.DAT",206
- ProductDat:
- DATA "PRODUCT.DAT",188
- InvoiceDat:
- DATA "INVOICE.DAT",160
-
- Rather simple, however, when I do an ARRAY DELETE on a completely different
- flexstring array, using the WATCH window, I watch filename$ go from
- ~CUSTOMER.DAT" to " " (notice, that the same number of characters,
- but the ascii characters are gone).
- Figure that one out! <grin>
-
- Dan
-
- Press <CR> for next or type CHOICES !
- H#: 54714 S12/SPECTRA Publishing
- 02-Jul-90 11:16:35
- Sb: #ERR 62 / input past end
- Fm: Eric Pearson 71641,717
- To: [F] Spectra 75300,214 (X)
-
- Using the following code...
-
- OPEN "TESTFILE" FOR INPUT AS #1
- WHILE NOT EOF(1)
- OneChar$ = INPUT$(1,#1)
- WEND
- CLOSE
-
- ... I'm getting ERR 62 on the input$. It seems to be related to file length;
- a file with length 257 always crashes, but add a character and it runs ok.
- (257= 2^8 +1?). The files contain one long string (ascii => 32), ending with a
- CR/LF.
-
- One of my customers is reporting a problem with a file of length 897 but I
- haven't tried it. Incid: PB _and_ TB both give the same error.
-
- -- Eric P.
-
- There is 1 Reply.
-
- Press <CR> for next or type CHOICES !
- H#: 54778 S12/SPECTRA Publishing
- 02-Jul-90 16:57:52
- Sb: #54714-#ERR 62 / input past end
- Fm: Barry Erick for Spectra 75300,214
- To: Eric Pearson 71641,717 (X)
-
- Eric,
- I ran this with no problem, using a file of 257 characters:
- OPEN "Testfile" for output as #2
- for x = 1 to 257
- print #2,"a";
- next
- close 2
- open "Testfile" for input as #1
-
- while not eof(1)
- foo$ = foo$+input$(1,1)
- loop
- close 1
- print len(foo$)
-
- No problem with this, and I use a similar routine in a comm program that
- varies on the size of the input file depending on the file sixe being saved or
- written with no problems. I suspect this is related to some other code.
- --- Barry
-
-
-
-
- There is 1 Reply.
-
- Press <CR> for next or type CHOICES !
- H#: 54847 S12/SPECTRA Publishing
- 03-Jul-90 03:20:20
- Sb: #54778-#ERR 62 / input past end
- Fm: Eric Pearson 71641,717
- To: Barry Erick for Spectra 75300,214 (X)
-
- Barry --
-
- The data files that I'm dealing with start out as text + CR/LF, and dos
- appends CtrlZ when the file is copied into my data directory. Try this...
-
- OPEN "TestFile" FOR OUTPUT AS #2
- FOR X% = 1 TO 256
- PRINT #2,"Q";
- NEXT
- PRINT #2,CHR$(26);
- CLOSE #2
-
- OPEN "TestFile" FOR INPUT AS #1
- WHILE NOT EOF(1)
- OneChar$ = INPUT$(1,#1)
- WEND
- CLOSE #1
-
- I assume it's the CtrlZ that's causing the problem, but the weird part is that
- the code works fine MOST of the time, but it crashes if the file happens to be
- just the right length. Replace the 256 with any multiple of 128 and the
- program will crash; other numbers work fine.
-
- -- Eric P.
-
- There is 1 Reply.
-
- Press <CR> for next or type CHOICES !
- H#: 54852 S12/SPECTRA Publishing
- 03-Jul-90 05:00:41
- Sb: #54847-ERR 62 / input past end
- Fm: Barry Erick for Spectra 75300,214
- To: Eric Pearson 71641,717
-
- Eric,
- Your problem is you are using a text input routine and that can't be used to
- bring in a eof marker. Use the Binary file mode if you must receive any
- character and then GET$(1,1,OneChar$). That is what I use (not input$) in my
- programs. I missed on that at first, but the ctrl z did it. :
- Open "Testfile" for binary as #2
- for x = 1 to 256
- put$ 2,"Q"
- next
- put$ 2, chr$(26)
- close 2
- open "TestFile" for binary as #1
- do until eof(1)
- get$(1,1,OneChar$)
- loop
- close 1
-
- That is what Binary file mode is for.... every and all characters, not just
- text.
- --- Barry
-
-
-
- Press <CR> for next or type CHOICES !
- H#: 54807 S12/SPECTRA Publishing
- 02-Jul-90 20:13:24
- Sb: SHIFT PROBLEM
- Fm: Kevin Johnson 72271,1764
- To: [F] Bob Zale 76304,1303 (X)
-
- Bob,
- I have been using Turbo Basic for a few years now and upgraded to Power
- Basic just recently. I have written a Shop Floor Tracking Program utilizing 6
- (six) Austin 386sx, 4 (four) Northgate (2)386-33, (1)386-25, (1)286-12.5, and
- 2 PS/2 Model 50z. I have been experiencing a SHIFT state problem on 2 (two)
- Austins (PHONIX 1.10.04 BIOS). It appears as if someone is holding down the
- shift key at random (i.e. > instead of .) This only occurs on the two Phoenix
- Bios machines (the other Austins are Quatel Bios and the Northgates are AMI).
- Austin Tech Support is telling me that it is a possiblity that my program (1st
- experienced on TURBO BASIC, then continued with the POWER BASIC upgrade.) is
- messing with address 751 & 752 which contain the shift state information (I am
- guessing the addresses, I left them at work). I told them that I am not
- directly pokeing or peeking in those address ranges.
-
- Do you have any ideas other than don't buy Austins with Phoenix Bios.
-
- P.S. I am also running Novell Advanced Netware v2.15.
- Thanks Kevin
-
- H#: 54908 S12/SPECTRA Publishing
- 03-Jul-90 10:51:07
- Sb: #54852-ERR 62 / input past end
- Fm: Eric Pearson 71641,717
- To: Barry Erick for Spectra 75300,214
-
- Thanks Barry... So INPUT$ can only be used on files that have not been
- _copied_ by DOS, even if they contain only text. Interesting! I'm still
- intrigued by the fact that it works unless the file length is a multiple of
- 128. Oh well...
-
- -- Eric P.
-
- Press <CR> for next or type CHOICES !
- H#: 54922 S12/SPECTRA Publishing
- 03-Jul-90 13:02:23
- Sb: #ARRAY CORRUPT
- Fm: John Gessner 71131,3256
- To: ANYONE
-
- SCREEN 12 Defint a-z %LightCounterColor
- = 15 %DarkCounterColor = 12 %BoxEdgeColor = 9 %BoxBottomColor
- = 1 %DarkTriangleColor = 6 %LightTriangleColor = 7 %ForGroundPrint
- = 14 %BackGround = 14
-
- DIM DYNAMIC Uptriangles(2728),DnTriangles(2728),GetBoard(29921) CLS
-
- 'Draw Bottom Triangles LINE (64 , 360)-(144 , 228) ,
- %BoxBottomColor , BF 'Background LINE (66 , 360)-(84 , 228) ,
- %DarkTriangleColor 'Draw it LINE (84 , 228)-(102 , 360) ,
- %DarkTriangleColor LINE (102 , 360)-(66 , 360) , %DarkTriangleColor
- PAINT (84 , 350), %DarkTriangleColor , %DarkTriangleColor 'Color it
- LINE (106 , 360)-(124 , 228) , %LightTriangleColor 'Draw it LINE
- (124 , 228)-(142 , 360) , %LightTriangleColor LINE (142 , 360)-(106
- , 360) , %LightTriangleColor PAINT (125 , 350), %LightTriangleColor ,
- %LightTriangleColor 'Color it GET (64 , 228)-(144 , 360),
- Uptriangles 'Get both triangles PUT (64 , 228) , Uptriangles
- 'Erase
- ' Draw Top Triangles LINE (64 , 13)-(144 , 145) ,
- %BoxBottomColor , BF 'Background LINE (66 , 13)-(84 , 145) ,
- %LightTriangleColor 'Draw it LINE (84 , 145)-(102 , 13) ,
- %LightTriangleColor LINE (102 , 13)-(66 , 13) ,
- %LightTriangleColor PAINT (84 , 30) , %LightTriangleColor ,
- %LightTriangleColor 'Color It LINE (106 , 13)-(124 , 145) ,
- %DarkTriangleColor 'Draw it LINE (124 , 145)-(142 , 13) ,
- %DarkTriangleColor LINE (142 , 13)-(106 , 13) , %DarkTriangleColor
- PAINT (110 , 15) , %DarkTriangleColor , %DarkTriangleColor 'Color it
- '*********** TEST FOR INTEGRITY OF ARRAY "Uptriangles" ***********
- LOCATE 10 ,38 : PRINT "The ARRAY Uptriangles"
- PUT (300,0),Uptriangles 'THE ARRAY Uptriangles is fine here
- LOCATE 11,38 : PRINT "Before GET"
- GET (64 , 13)-(144 , 145) , Dntriangles 'Get new array
- LOCATE 10 , 9 : PRINT "The GET"
- PUT (400,0),Uptriangles ' NOW THE ARRAY IS CORRUPTED
- LOCATE 11,52 : PRINT "After GET" u$ = INPUT$(1) END '********** ENDS TEST
- OF "Uptriangles ************** PUT (64 , 13) , Dntriangles
- 'Draw the box LINE (0,0) -(639,3A(X
-
- There is 1 Reply.
-
- Press <CR> for next or type CHOICES !
- H#: 54927 S12/SPECTRA Publishing
- 03-Jul-90 13:52:11
- Sb: #54922-#ARRAY CORRUPT
- Fm: John Gessner 71131,3256
- To: John Gessner 71131,3256 (X)
-
- Wow! What happend to my program (above message). It is a simple program
- straight from the PB editor. I used Ymodem to upload it. What did I do wrong?
- Anyway it demonstrates the following: I am drawing a backgammon board in screen
- 12. I use put and get in the process two arrays. When I GET the second array,
- the first array is corrupted. When I PUT it again it's screwed up. I can't
- figure out what's wrong. Help? If anyone can tell me what I did wrong in
- uploading, I'll upload again.
-
- There is 1 Reply.
-
- Press <CR> for next or type CHOICES !
- H#: 54936 S12/SPECTRA Publishing
- 03-Jul-90 15:22:52
- Sb: #54927-ARRAY CORRUPT
- Fm: Bob Zale: PowerBASIC R&D 76304,1303
- To: John Gessner 71131,3256 (X)
-
- John --
- The upload problem is that the forum software wraps lines to conserve space.
- To keep your format intact, you need to insert one or more spaces at the start
- of each line. I'm going to look at the file as-is and see what we can find,
- but if you try again, we might be more certain of the file integrity/accuracy.
- Thanks!
- Bob Zale (PowerBASIC R&D)
-
- Press <CR> for next or type CHOICES !
- H#: 54959 S12/SPECTRA Publishing
- 03-Jul-90 17:08:29
- Sb: new array corrupt
- Fm: John Gessner 71131,3256
- To: all
-
- SCREEN 12
- Defint a-z
- %LightCounterColor = 15
- %DarkCounterColor = 12
- %BoxEdgeColor = 9
- %BoxBottomColor = 1
- %DarkTriangleColor = 6
- %LightTriangleColor = 7
- %ForGroundPrint = 14
- %BackGround = 14
-
- DIM DYNAMIC Uptriangles(2728),DnTriangles(2728),GetBoard(29921)
- CLS
-
- 'Draw Bottom Triangles
- LINE (64 , 360)-(144 , 228) , %BoxBottomColor , BF 'Background
- LINE (66 , 360)-(84 , 228) , %DarkTriangleColor 'Draw it
- LINE (84 , 228)-(102 , 360) , %DarkTriangleColor
- LINE (102 , 360)-(66 , 360) , %DarkTriangleColor
- PAINT (84 , 350), %DarkTriangleColor , %DarkTriangleColor 'Color it
- LINE (106 , 360)-(124 , 228) , %LightTriangleColor 'Draw it
- LINE (124 , 228)-(142 , 360) , %LightTriangleColor
- LINE (142 , 360)-(106 , 360) , %LightTriangleColor
- PAINT (125 , 350), %LightTriangleColor , %LightTriangleColor
- GET (64 , 228)-(144 , 360), Uptriangles 'Get both triangles
- PUT (64 , 228) , Uptriangles 'Erase
- ' Draw Top Triangles
- LINE (64 , 13)-(144 , 145) , %BoxBottomColor , BF 'Background
- LINE (66 , 13)-(84 , 145) , %LightTriangleColor 'Draw it
- LINE (84 , 145)-(102 , 13) , %LightTriangleColor
- LINE (102 , 13)-(66 , 13) , %LightTriangleColor
- PAINT (84 , 30) , %LightTriangleColor , %LightTriangleColor
- LINE (106 , 13)-(124 , 145) , %DarkTriangleColor 'Draw it
- LINE (124 , 145)-(142 , 13) , %DarkTriangleColor
- LINE (142 , 13)-(106 , 13) , %DarkTriangleColor
- PAINT (110 , 15) , %DarkTriangleColor , %DarkTriangleColor
- '*********** TEST FOR INTEGRITY OF ARRAY "Uptriangles" ***********
- LOCATE 10 ,38 : PRINT "The ARRAY Uptriangles"
- PUT (300,0),Uptriangles 'THE ARRAY Uptriangles is fine here
- LOCATE 11,38 : PRINT "Before GET"
- GET (64 , 13)-(144 , 145) , Dntriangles 'Get new array
- LOCATE 10 , 9 : PRINT "The GET"
- PUT (400,0),Uptriangles ' NOW THE ARRAY IS CORRUPTED
- LOCATE 11,52 : PRINT "After GET"
- u$ = INPUT$(1)
- END '********** ENDS TEST OF "Uptriangles **************
- PUT (64 , 13) , DntrA(Xi
-