Tab ? (tabulator)

How to write in the correct column with Xojo? With VB I used print tab (20) var, tab (30) var …

new mac user.

Have you had a look at the documentation for Listbox?

Listbox.Cell( aRowNumber, aColumnNumber) = aNewValue

the code i´m using now is
Dim f As FolderItem
f = GetFolderItem("/users/svennoddvardemmo/Dropbox/logg/logg.txt", FolderItem.PathTypeShell)

Dim t as TextOutputStream

dim d as new Date

t = TextOutputStream.Append(f)

t.Write(d.ShortDate)+"*"+(d.ShortTime)+" "+"mtsent "+"mtperi "+"mtinnl "+"mtsnitt "+"maltt "+"mtinnst "+"meskvol "+"Hlttmålt "+"Hlttinn “+“Hltvolm”+endofline
t.Write " “+ mesktempsentl.text+” “+mesktempperl.text+” “+meskinnløpl.text+” “+mesktempsnittl.text+” “+malttempl.text+” “+mesktempinnst.text+” “+meskvolmåltl.text+” "
t.Write hlttempmåltl.text+” “+hlttempinnstiltl.text+” “+hltvolmåltl.text
t.Write” “+kokekjeltempl.text+” "+kokekjelvoll.text+EndOfLine

t.Close

but it is messy

put ch(9) instead of your spaces " " between the fields in your code.

OK, the new code:
Dim f As FolderItem
f = GetFolderItem("/users/svennoddvardemmo/Dropbox/logg/logg.txt", FolderItem.PathTypeShell)

Dim t as TextOutputStream

dim d as new Date

t = TextOutputStream.Append(f)

t.Write(d.ShortDate)+chr(9)+(d.ShortTime)+chr(9)+"mts "+chr(9)+“mtp”+chr(9)+“mti”+chr(9)+“mtsn”+chr(9)+“maltt”+chr(9)+chr(9)+“mtin”+chr(9)+“meskv”+chr(9)+“Hlttm”+chr(9)+“Hltti”+chr(9)+“Hltvo”+chr(9)+“kokv”+endofline
t.Write chr(9)+chr(9)+chr(9)+ mesktempsentl.text+chr(9)+mesktempperl.text+chr(9)+meskinnløpl.text+chr(9)+mesktempsnittl.text+chr(9)+malttempl.text+chr(9)+mesktempinnst.text+chr(9)+meskvolmåltl.text+chr(9)
t.Write hlttempmåltl.text+chr(9)+hlttempinnstiltl.text+chr(9)+hltvolmåltl.text
t.Write chr(9)+kokekjeltempl.text+chr(9)+kokekjelvoll.text+EndOfLine
t.Close

and the result look better:

Thenks

a. Did you read the TextOutputStream entry in the documentation ?

b. GetFolderItem("/users/svennoddvardemmo/Dropbox/logg/ …
this will not works if you make a typo in the path / if there is a missing folder in the path, etc.

Personnaly, I let the user to select the destination / use .Child and many lines to get a FolderItem…

That said, this is me.

c. You do not test the f error condition (against Nil if any error).

Once again, read the documentation for FolderItem.

Thanks, but this app is only for me on my mac and i work very well.
Of course i have to read and learn more, but now i am happy :slight_smile: