Forum Replies Created
-
AuthorPosts
-
April 11, 2018 at 11:00 am in reply to: using suneido for webbased applications and mobile applications #1395
amckinlay
KeymasterSorry for the slow response, I missed your post.
It is possible to develop web-based applications using Suneido as the server and database (with RackServer). My company does this for some applications. But then you cannot use Suneido’s application framework. You just program in HTML, CSS, JavaScript on the front end. You can use things like the Razor templates on the Suneido backend.
Unfortunately, Suneido has no support for mobile applications. You could use Suneido for the backend database.
Suneido works fine on Windows 10.
Best wishes!
amckinlay
KeymasterHere is the simplest example:
Params(['ShortDate', Date()])Reports work in terms of “formats”. In this case I used ShortDateFormat. Often the data is coming from the database, but many formats allow you to pass it explicitly as well.
You probably want more stuff on the report, so you can use Vert and Horz to compose formats. For example:
Params(['Vert', ['ShortDate', Date()], ['LongDate', Date()]])Or if you are using a QueryFormat, you can use do things like:
Params(QueryFormat { Query: 'tables' Before() { return ['Text', Date().LongDate()] } })(In this case I had trouble getting LongDateFormat to work, so I just used Text and formatted the date myself.)
Hopefully that will give you some ideas.
amckinlay
KeymasterSorry for the slow reply. I have been traveling. The last reply was from Li, not me.
I’ll try to get a chance to look into this.
amckinlay
KeymasterI’m not sure what the errors are from. I’m traveling again (and so is Jeff), but I’ll see if I can get someone to look into it.
“name:”, which becomes .Name after construction, is used for several things. For example, when you refer to a control by e.g. .Horz.Field the “Horz” and “Field” are the names of the respective controls. A lot of controls have default names (look for Name: on the class) but the default name can be overridden by specifying name: on the control specification e.g. (Horz … name: myhorz)
When you specify just a field name, so the control comes from the Field_ definition, then the name is automatically set to the field name.
RecordControl also uses the names as the field names in the record that it manages. This works with any control that is “data aware” i.e. Send ‘Data’, ‘NewValue’, and ‘NoData’. Most of the standard controls e.g. Field and CheckBox are like this.
I hope that helps explain it a little.
amckinlay
KeymasterThanks for spotting that. It should be fixed now.
amckinlay
KeymasterHi Ajith,
I think all you need to do is add name to the Repeat
(Repeat (...) name: field3)Andrew
amckinlay
KeymasterSorry, discovered I had the wrong icon on the exe so I created a new 200180117 release. Everything else is the same.
amckinlay
KeymasterSorry, can you give me more information? What steps did you do to upgrade? What does “incomplete” mean? Are you missing tables? Or just some records?
amckinlay
KeymasterWARNING: Make sure you have backup copies before doing this. It is easy to get mixed up and overwrite things.
There are two main approaches. If your app does not have many libraries and tables, then you can individually dump them from the old database, copy them to the new directory, and load them into the new one.
Or you can go the other way. Individually dump stdlib, suneidoc, and imagebook from the new databse. Dump your entire old database and copy it to the new directory. Load the old database with the new version of suneido. Then load the new stdlib, suneidoc, and imagebook into the converted database.
To dump and load an entire database (suneido.db <=> database.su)
> start /w suneido -dump
> start /w suneido -load
To dump and load individual tables: (to/from
.su) > start /w suneido -dump
> start /w suneido -load
This is from the command line, not inside suneido.
suneido.db and the .su file must be in the same directory. You cannot specify a path on the tablename.
amckinlay
KeymasterHi Ajith,
That is often awkward with recursive functions. There are several options.
One is to have default values for the extra parameters. However, default values must be constants so you need to do something like:
function (ob, size = false, result = false) { if size is false size = ob.Size() if result is false result = Object()This is the simplest, but the extra parameters could confuse users.
Another option is to use two functions but to bundle them together, either using a class:
class { CallClass(ob) { return .permute(ob, ob.Size(), Object()) } permute(ob, size, result) { ... // recursively calling .permute } }CallClass is special so this can still be called like a function.
Or you can use a block:
function (ob) { permute = {|ob, size, result| ... // recursively calling permute result // without 'return' because that would return from outer function } return permute(ob, ob.Size(), Object()) }amckinlay
KeymasterThe trick is to write a string containing the bytes you want to output.
e.g.
f.Write('\x0d\x06')Note: You need to get the byte order correct i.e. it might need to be \x06\x0d
The upcoming change in Suneido is that it will not automatically convert strings to number e.g. for arithmetic. However, literal numbers like 0x0D06 will still be handled. 0x0d06 and 3334 are just different representations for the same underlying number.
amckinlay
KeymasterSorry about that. Unfortunately, things like that tend to get contributed and never updated.
You can find old versions on SourceForge https://sourceforge.net/projects/suneido/files/Snapshots/
amckinlay
KeymasterAny corrections would be welcome. Thanks!
amckinlay
KeymasterI have switched to the 2017 community version and I think the 2015 solution/project is slightly out of date. Wouldn’t be hard to fix, but I’d suggest upgrading to 2017.
Unfortunately, building from source doesn’t get you the latest stdlib and documentation. I have been thinking of how to get this onto github as well.
I’m still traveling but a new release is on my todo list.
May 28, 2017 at 9:26 am in reply to: Newbie question #4 — open multiple db's or read another suneido db from open db #1307amckinlay
KeymasterNot directly. We run an http server on each of the systems and communicate between them that way.
-
AuthorPosts