My code:
This fairly simple code has been running flawlessly for several years both on my development computer (Win10Pro) and on customer's Win 7 computers. Still works on theirs, but on mine, choosing the Customer section of the program, the entire screen just disappears. Other menu choices (invoicing, payments, etc.) work. I am using an exact copy of their customer data. The program is loading a table with the entire customer file, and it processes these few lines for each customer. In order to debug, I have inserted print lines followed by waitkey$ after each line so I can see how far it gets with what data. It varies. If I press the enter key after each wait in a slow rhythm, I can get about halfway through loading the 84 customers. If I get impatient and click faster, it bombs sooner. And, as I said initially, without any waitkey$'s, it bombs immediately. Also, I am using the same .bas code originally used to compile theirs (the current working version), but recompiling it on my computer and then running it on their system bombs in same fashion as on my computer. Confused? Me too. Any ideas? It bombs when using PBCC Editor or in old JellyFishPro.
Code:
Xcust$=Mid$(customer,540) FOR JK& = 34 TO 36: J& = INSTR(Xcust$, CHR$(124)) IF J& > 1 THEN cust(jk&) = LEFT$(Xcust$, J& - 1): Xcust$ = MID$(Xcust$, J& + 1) IF J& = 1 THEN Xcust$ = MID$(Xcust$, 2):cust(jk&)="" If Len(Xcust$) <2 Then cust(jk&) = String$(75," ") ELSE cust(jk&) = Left$(cust(jk&) & String$(75," "),75) END IF NEXT
Comment