[Gambas-user] Using Open in Gambas 3
charlesg
charles at ...1784...
Mon Sep 6 12:45:48 CEST 2010
Fabien Bodard-4 wrote:
>
> this is new since gb2
>
Not sure about that. The following works even back to 2.13
DIM j AS Integer = 0
INC Application.busy
hFileOut = OPEN "/home/charles/rba/rba.csv" FOR CREATE
sql = "select * from stmaster"
res = mdFile.$hConnStock.Exec(sql)
FOR EACH res
IF j > 100 AND j < 120 THEN
sellPriceExVat = (Round(res!st_sellprice1 / 1.175 * 100, 0)) / 100
IF res!st_datelastsale > CDate("01/01/2000") THEN
dDate = Format(res!st_datelastsale, "dd/mm/yyyy")
ELSE
dDate = ""
ENDIF
sLine = Chr(34) & res!st_code & Chr(34) & "," & Chr(34) & res!st_desc
& Chr(34) & "," & Chr(34) & res!st_barcode & Chr(34) & "," & Chr(34) & "ZZ"
& Chr(34) & "," & "999" & "," & "0" & "," & Chr(34) & "S" & Chr(34) & "," &
Chr(34) & "Y" & Chr(34) & "," & Chr(34) & res!st_unit & Chr(34) & "," & "1"
& "," & Chr(34) & "ALDRIDGE" & Chr(34) & "," & Chr(34) & dDate & Chr(34) &
"," & res!st_minimum & "," & Chr(34) & "" & Chr(34) & "," & "1" & "," &
"0.95" & "," & "0.95" & "," & sellPriceExVat & "," & res!st_sellprice1
PRINT #hFileOut, sLine
ENDIF
j += 1
NEXT
#hFileOut.Close
DEC Application.Busy
rgds
--
View this message in context: http://old.nabble.com/Using-Open-in-Gambas-3-tp29630809p29632831.html
Sent from the gambas-user mailing list archive at Nabble.com.
More information about the User
mailing list