|
Author |
Topic: export and variables in Setup::size (Read 324 times) |
|
jes
|
export and variables in Setup::size
« on: Aug 5th, 2002, 5:09pm » |
|
This may not be a bug, but a feature...depending on how you look at it: I noticed that several of the example programs people have submitted have a problem when they are "exported to web". The applet width and height tag are not being evaluated and a default 100 x 100 tag is inserted. An error is thrown when these examples are exported which begins with java.lang.NumberFormat.Exception: width (BTW, it sure would be nice to copy/paste) The programs that exhibit this problem are programs that initialize variables and then use these variables in the size( ) function of the Setup routine. If you use "size( 300, 400 )" export works but "size( width, height )" does not. I suppose it's an issue of - how close do you want to come to duplicating existing programming syntax?
|
|
|
|
fry
|
Re: export and variables in Setup::size
« Reply #1 on: Aug 5th, 2002, 7:01pm » |
|
in general, size() needs to use just straight integers, not variables. particularly for export, because the exporter reaches into the program and grabs the variables for size from the code. if it's size(width, height) it tries to use that, and that's where the NumberFormatException comes from. similarly if you're using straight draw mode (beginner mode, no "void loop()" method) background() will behave the same way, even when not exporting. we'll try to document this better in the future, but there's small likelihood of it changing.
|
|
|
|
fry
|
Re: export and variables in Setup::size
« Reply #2 on: Sep 2nd, 2003, 8:07am » |
|
i've finally implemented this properly in rev 60, so size() can use variables, etc.
|
|
|
|
|