[futurebasic] Re: Bug In FB or my Invoice Program?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2001 : Group Archive : Group : All Groups

From: Stu Cram <stu.cram@...>
Date: Mon, 30 Jul 2001 21:55:32 -0600
Brian Heibert wrote:  (My response is at the end)

>The portion of the program listed below is not saving the files
>properly, it will save the text INPUTED PRODUCT: for example but not the
>text that was in the product$ variable.
>
>Also I am getting a error message -43
>Al said he was getting error messages -43 and -37
>
>We are not sure whether this is a FB bug or a bug with my code, Al agrees
>with me that he can't find a problem with my code.
>
>-Brian
>
>LOCAL FN SaveData
>dim savefil$,refNumVar%
>dim mPrompt$,defaultname$
>mPrompt$ = "Save DB-Invoice As..."
>defaultname$ = file$
>gFBUseNavServices = _zTrue
>savefil$ = FILES$(_fSave,mPrompt$,defaultname$, refNumVar%)
>gFBUseNavServices = _zTrue
>long if savefil$ <> ""
>DEF OPEN "TEXTttxt"
>open  "O", #1, savefil$,,refNumVar%
>'Bug In this
>COLOR=cresult
>TExT _Monaco,12,0
>PRINT #1, " "
>PRINT #1, "                      TROHEN SERVICES COMPANY INVOICE SHEET"
>PRINT #1, " "
>PRINT #1, "                                     INVOICE TYPES : "
>PRINT #1, ""
>PRINT #1, "   ( ) RECIEPT FOR PAYMENT MADE"
>PRINT #1, "   ( ) INVOICE FOR UNPAID SERVICE"
>PRINT #1, "   ( ) OTHER: [                                             ]"
>PRINT #1, " "
>PRINT #1, "    PRODUCT:   ( ) TBASIC  ( ) TROHENWEB SERVICE ( ) MP3 SERVICE"
>PRINT #1, "               ( ) SOFTWARE PRODUCT  ( ) OTHER [               ]"
>PRINT #1, " "
>PRINT #1, "    INPUTED PRODUCT: ",product$
>PRINT #1, "    PRICE $",price$
>PRINT #1, "    REP # ",trep$
>PRINT #1, " "
>PRINT #1, "    CUST NME ",nme$
>PRINT #1, "    FILE REF ",file$
>PRINT #1, "    REF DATE ",rd$
>PRINT #1, "    CUST ADDR #1 ",cao$
>PRINT #1, "    CUST ADDR #2 ",cat$
>PRINT #1, "    CUST ADDR #3 ",car$
>PRINT #1, "    CUST CITY #4 ",cca$
>PRINT #1, "    CST STATE #5 ",cssx$
>PRINT #1, "    CUST ZIP  #6 ",czip$
>PRINT #1, "    CST POSTCD #7 ",cpcode$
>cddate$ = DATE$
>PRINT #1, " "
>PRINT #1, "    CUSTOMER SIGNATURE _______________________________ DATE:
>__/__/_____"
>PRINT #1, " "
>PRINT #1, "    -------------------- TSC EMPLOYEE SECTION ONLY
>--------------------- "
>PRINT #1, " "
>PRINT #1, "    COMMENTS: "
>PRINT #1, " "
>PRINT #1, "   ",cm$
>PRINT #1, "   ",cm1$
>PRINT #1, "   ",cm2$
>PRINT #1, "   ",cm3$
>PRINT #1, "   ",cm4$
>PRINT #1, "   ",cm5$
>PRINT #1, "   ",cm6$
>PRINT #1, " "
>PRINT #1, "    ONE COPY GOES TO CUSTOMER, OTHER GOES TO TSC (TROHEN)"
>PRINT #1, "    TSC EMPLOYEE ___________________________ DATE: __/__/_____"
>TEXT _Monaco,10,0
>PRINT #1, "    FORM # TDI-INV007 OTHER
>__________________________________________"
>COLOR=_zWhite
>CLOSE #1
>XELSE
>savefil$ = file$
>END IF
>
>END FN

============
Hi Brian;   Here're my thoughts FWIW.

1. I would check that variable product$ is defined as a GLOBAL 
variable. If not, then a local variable is being used and it is 
undefined which explains why you see nothing printed in the file or 
the occasional error due to overwriting of data accidentally by 
product$. Same thing for other variables later on.

2. I'm not sure of the reason for the COLOR or TEXT commands with a 
text file. I thought that only text data would be written to the file 
and not any formatting info. They don't have any effect on your 
file's data, I think.

Hope this helps.

-Stu C.