Forum Replies Created
- AuthorPosts
- JD KromkowskiParticipant
I've tried to pair this down to a version of the documentation
(Object-Oriented Database Access Chapter 13), which works fine (so who
knows):sbme1record r
sbme1field fld
string sResult
integer c
c = appw.form.mastertable.fieldinfo[]
r =@ appw.form.masterrecord.record
fld =@ r.table.firstfield
while c > 0
if fld.datatype =@= string
sResult = fld.name + ": " + r.get(fld) + "{d}{a}"
else if fld.datatype =@= integer or fld.datatype =@= date or
fld.datatype =@= time
sResult = fld.name + ": " + .tostr(r.get(fld), 10) + "{d}{a}"
else if fld.datatype =@= number
sResult = fld.name + ": " + .tostr(.fix(r.get(fld), 100), 10) +
"{d}{a}"
end if
fld =@ fld.next
c = c -1
end whileJD KromkowskiParticipantlookup()
Tools for Converting SBL to SIMPOL
Chapter 20. Moving from SBL to SIMPOLin Programmer's Guide
I subsequently found it, although am not sure how to use it yet.
By the way, I hate that there are 6 different help "documents":
SIMPOL IDE Doc
SIMPOL IDE Tutorial
SIMPOL Language Ref
SIMPOL Programming Guide
SIMPOL Quick Start Guide
SIMPOL Personal User GuideWith exception of the Personal User Guide, why can't these all be in one
thing. And why can't I get to them all from the IDE. I'm never really
sure where I should be looking for things.On that note, why can't I get to Personal from a menu pick in the IDE.
JD KromkowskiParticipantSorry this is sort of stream of consciousness:
So, in fact, I don't need to 'focus' the table when I am switching forms,
at all. I can actually add and modify records on either form. Things are
working.The only "problem" is that the Table icon is fixed (now I understand what
you meant) but in fact the indexes are not, they do change to the
appropriate index for the mastertable of whatever form is loaded. So onec
"solution" is probably just getting rid of that part of the Iconbar, since
it actually serves no functionality in its current iteration. (Although,
obviously the code exists and is fixable because it works properly in
Personal.)So onto the next question: Simpol version of look-ups on forms.
I added an Onchange to a field on a form, called LookUp().
It's not clear to me how in Personal, I could add a reference to the
Onchange function. (Do I have to go in and edit the .sxf?)Then, I added this function to the end of the mainmenu.sma to test.
function LookUp(type(*) me)
string something
something = "something"
wxmessagedialog(.nul,message = something,captiontext =
sAPPMSGTITLE,style = "ok", icon = "information", result = .nul)
end functionThen I changed to
function LookUp(type(*) me)
string sFullName
integer iSSN
sFullName =
me.form.masterrecord.record.get(me.form.mastertable.table!FullName)
iSSN = me.form.masterrecord.record.get(me.form.mastertable.table!SSN)
wxmessagedialog(message = sFullName,captiontext = .tostr(iSSN,10))
end functionSo I am having somewhat of a sense that there is light at end of tunnel.
Any help on what a generic LookUp() function might look like in Simpol.
I saw in documentation that there is a lookup() function purportedly in
uisyshelp.sml but I don't see it.JD KromkowskiParticipantOk so I've been able (using SBAIR) to change back and forth between two
forms
(which were set as contstants).But the problem is "focusing" for lack of better word the table.
Obviously, this can be done because it is happening in Personal.function ChangeForms(wxmenuitem me, type (application) app)
appwindow appw
appw =@ getappwindowfromwindow(getmenuitemwindow(me))
if sSecondForm == appw.form.filename
appw.openformdirect(sFirstForm,sAPPMSGTITLE)
//how do I make sure the table is correct
else
appw.openformdirect(sSecondForm,sAPPMSGTITLE)
//how do I make surec the table is correct
end if
end functionJD KromkowskiParticipantNow it seems to work? who knows.
But since the table is now set at Passengr, how do you add a Flight?
This is back to the problem I was trying to sort out before, opening up a
new form – one that allows you to add a record in the Flight table.In what I was working on:
I have an Employee table – lists of employees.
I have a Wage table – basically a record for each they work (starttime and
endtime)One Employee – many days worked (wages).
One Flight – many passengers.The thought was a main form would be an employee record with a wage
detailblock. (Although, ironically I don't actually do it that way now in
Superbase, my mainform is the daily record and when I enter a daily
record, I am using the Employee table/file to look up – name, ssn, rate
and to add or modify an Employee – the mainform closes and the Employee
form opens. But either way, this is the nut to crack – I tried one version
with a modal dialog using a wxform as the input but then you have to have
a routine to take that information and put it into a record, so why not
just do it with a dataform.)JD KromkowskiParticipantBut never of these fixes, enables you to search by FlightDate.
FlightDate is a field of the "Passenger" table not the flight table.Amazingly, Flight table does not have a FlightDate field!
Everthing now seems to be broken.
maybe I was right
me.passengr
AND
passengr in the application type.
??
JD KromkowskiParticipantJDK wrote:
> Neil Robinson wrote:
>> In sbair.sma, on line 310, change me.flight to me.passenger.> I think you mean
> me.passengr
Obviously I was wrong and you were right — because of the wag passenger
is spelled in type?me.passenger =@ t
JDK
> Is there a switch to see line numbers?
> type sbairapplication (application)
> reference
> application __app resolve
> type(db1table) passenger
> type(db1table) flight
> end type> should this really be "passengr"
> And why "flight" and "passeng[e]r" instead of "FLIGHT" and "PASSENGER"
> This is confusing to me since I had trouble opening up a table named
> "wages" when I should have been opening "WAGES".JD KromkowskiParticipantNeil Robinson wrote:
> In sbair.sma, on line 310, change me.flight to me.passenger.I think you mean
me.passengr
Is there a switch to see line numbers?
type sbairapplication (application)
reference
application __app resolve
type(db1table) passenger
type(db1table) flight
end typeshould this really be "passengr"
And why "flight" and "passeng[e]r" instead of "FLIGHT" and "PASSENGER"
This is confusing to me since I had trouble opening up a table named
"wages" when I should have been opening "WAGES".As to file and index combos, I've never used them (hard to believe I've
been fooling around with this for 20 years and still don't know how to
program). I hate the idea of someone search for "something" when the index
was set to "somethingelse", so I've always explicited handled via a menu
or buttons have "SEARCH by this thing" and "SEARCH by this otherthing".JDK
JD KromkowskiParticipantWhat I am seeing is that every time I open a form with ppcs datasource
whether in Personal or in IDE I get this message. (Of course, I am also
getting error 10 message because I haven't run the simpolserver thing.) I
am recalling that I had asked about this a long time ago. Does that sound
right? I think I've duplicated it.February 28, 2012 at 6:48 pm in reply to: Incorrect dataform1text code output by savedf1program function #1584JD KromkowskiParticipantI think the problem is worse that this. I don't think the save as
dataform program is actually working at all. It's not creating a
dataform1 program at all it's creating a wxform program.So "save as" "dataform1 program" and save as "wxform program" are doing
the same thing, i.e. create a wxform program.JD KromkowskiParticipantThis didn't have anything to do with threads.
Once I changed the variable names and started over things started working
properly.I'm not sure where the variables and values are being temporarily stored
but there was some kind of corruption.I'll keep an eye on this to see if it is reproduceable.
JDK
JD KromkowskiParticipantThis still appears to not work as one would think.
1. Open a form with a date index.
2. Choose the date field as the index.
3. Use the select record ("?")
4. Put in a date like "1/1/2010".
You might as well be searching with the "0" that is there as a default.
Upon further examination it looks like you have to (in you head, I guess)
change
"1/1/2010" to 733672.But I am not exactly sure that using the Julian number actually is doing
it correctly. But although 733672 is "1/1/2010" I get taken to a record
with the date of "12/22/2009", which I presume means that I need the
Gregorian number.In either case, surely the way this should work is that when selecting a
record by a date index, anyone should be able to put in date (1/1/2010 or
Jan 1, 2010) and get the right record.JD KromkowskiParticipantOK now this problem has gone away!
I did change some firewall settings and was prompted to block or unblock
the IDE (I unblocked) and allow once or allow always the IDE. I allowed
always.And now the form works in IDE.
JD KromkowskiParticipantNeil Robinson wrote:
> The way in the interim is to open the
> form file and delete that page block from the XML.Yes, I had already figured this out. In fact, sometimes it is easily just
to edit the XML.JD KromkowskiParticipantNeil Robinson wrote:
> Assuming a project called foo:
> foo – the project directory
> foofoo.smj – the project file
> foofoo.smw – the workspace file
> foofoofoo.sma – the source code
> foofoofoo.smp – the compiled source code
> foobinfoo.smp – the final binary (including any linked *.sml files)1. I now understand the difference, but the final binary will not have the
name "foobinfoo.smp", it will have the name "foofoofoo.smp".2. Nonetheless, this does not explain the problem that the ppcs forms
will not properly execute or debug from the IDE. By properly, excute or
debug, I mean that while the form opens no data is visible.In other words:
A. Open ppcs form in Personal, fine.
B. Run .smp program which uses opendataform1(), fine.
C. Debug or Execute the same source which compiles into B. in the IDE and
the form opens, but no data is visible.You can easily test this by debugging or executing the dataform example
project in the IDE and choosing a form which uses ppcs datasource.This did not happen in v 1.3.
JDK
- AuthorPosts