WriteTable() and error handling

Discuss any general programming issues here
Post Reply
Flinx
Posts: 390
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

WriteTable() and error handling

Post by Flinx »

Code: Select all

;t={}
OpenFile(1, "test", #MODE_WRITE)
err=?WriteTable(1, t, {Adapter="default"})
"Error in line 3 (test.hws): Table expected in argument 2!"

I just noticed that error handling with WriteTable() isn't working. With RaiseOnError() it's the same.
Am I doing something wrong or is this a bug?
plouf
Posts: 747
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: WriteTable() and error handling

Post by plouf »

isnt error gone when removing ; (comment) from ;t={} ?
Christos
Flinx
Posts: 390
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: WriteTable() and error handling

Post by Flinx »

Of course, but I just wanted to show here that the question mark doesn't work.
plouf
Posts: 747
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: WriteTable() and error handling

Post by plouf »

ok see sorry.

according to manual, passing wrong numbers of arguments consider syntax error and cannon be caught, instant exiting script (second sentence from bottom)-> https://www.hollywood-mal.com/docs/html ... dling.html

errors can be caught if a procedure is designed for, for example loading a file than do not exist
Christos
Flinx
Posts: 390
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: WriteTable() and error handling

Post by Flinx »

Thanks, I hadn't noticed that.
Post Reply