Forums › Forums › SIMPOL Programming › SBAIR Example Dates
- This topic has 10 replies, 2 voices, and was last updated 12 years, 1 month ago by JD Kromkowski.
- AuthorPosts
- March 7, 2012 at 8:13 am #245JD KromkowskiParticipant
In the SBAIR example, if I try to “select” by key (the ? button) when the index is FlightDate, this doesn’t seem to work. If I open the data sources first and then checkin form in personal, I can search. I think the problem is that the index is set to “FlightDate” BUT the table is “FLIGHT”. FLIGHT doesn’t have a field or index called “FlightDate”. “FlightDate” is indexed field for the PASSENGR. So while you can change the indexes in the icon bar; you really can’t even change the Table in the Icon bar it is “grayed out” and hence stuck on FLIGHT. I’m a simpleton, so it is no surprise that I find the whole application framework to be way too complicated to fully appreciate. It continues to seem to me that the essential information (datasources,tables, fields, indexes) is already available from a particular loaded form, which one has created: So I understand why it would not make sense to have something more in nature of a “form framework”. I realize that I am really going to have to move my application from SB2 (works fine in SB3 but I don’t have multi-user SB3, only the demo version although I did own the single version the “tattored suitcase” version back in 94/5 I have no idea where it is) to Simpol soon. But converting to Simpol even with the SBAIR example is so not turnkey or RAD, because I don’t fully understand how it works, yet.
March 14, 2012 at 1:48 am #1701MichaelKeymasterOn 07/03/2012 18:13, JDK wrote:
> In the SBAIR example, if I try to "select" by key (the ? button) when
> the index is FlightDate, this doesn't seem to work.
>
> If I open the data sources first and then checkin form in personal, I
> can search.
>
> I think the problem is that the index is set to "FlightDate" BUT the
> table is "FLIGHT". FLIGHT doesn't have a field or index called
> "FlightDate". "FlightDate" is indexed field for the PASSENGR. So
> while you can change the indexes in the icon bar; you really can't
> even change the Table in the Icon bar it is "grayed out" and hence
> stuck on FLIGHT.Actually, that is a display problem. The master table of a form is
fixed. It is arguable that the file combo doesn't need to be there at
all, I have dropped it from my newer work. Nonetheless, there are two
bugs in the sbair example. In toolbar.sma, replace the function
findcomboliststring() with the following code:function findcomboliststring(type(*) lb, string s)
integer i
boolean found
string tfound = .false
if lb.type =@= wxformlist or lb.type =@= wxformcombo
i = 1
while i <= lb.itemcount
t = lb
if s == t
found = .true
else
i = i + 1
end if
end while found
end if
end function foundIn sbair.sma, on line 310, change me.flight to me.passenger.
> I'm a simpleton, so it is no surprise that I find the whole
> application framework to be way too complicated to fully appreciate.
> It continues to seem to me that the essential information
> (datasources,tables, fields, indexes) is already available from a
> particular loaded form, which one has created: So I understand why
> it would not make sense to have something more in nature of a "form
> framework".Yes, the dataform1 objects manage that already. The application
framework provides management of application level and window level
information.> I realize that I am really going to have to move my application from
> SB2 (works fine in SB3 but I don't have multi-user SB3, only the demo
> version although I did own the single version the "tattored suitcase"
> version back in 94/5 I have no idea where it is) to Simpol soon. But
> converting to Simpol even with the SBAIR example is so not turnkey or
> RAD, because I don't fully understand how it works, yet.Keep asking questions. I am still working on the examples and the
documentation.Ciao, Neil
March 23, 2012 at 3:37 pm #1913JD 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
March 23, 2012 at 3:41 pm #1549JD 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".March 23, 2012 at 4:51 pm #1437JD 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.
??
March 23, 2012 at 5:22 pm #1471JD 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.)March 23, 2012 at 8:17 pm #1588JD 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 functionMarch 26, 2012 at 4:40 pm #1623JD 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.March 28, 2012 at 7:59 am #1683MichaelKeymasterOn 26/03/2012 17:40, JDK wrote:
> Sorry this is sort of stream of consciousness:No problem, I have been other where busy recently so just got into this.
> 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.That is as it should be. The appframework is meant to do most of it for you.
> 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.)I am pretty sure I tracked that one down a little while back and fixed it. Something was not firing that should have updated it.
In fact, in an environment that only uses form view, it is irrelevant. I have removed it in my own form-based apps.> 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?)No, you can't add a reference successfully at that stage. That is why they aren't stored in there. In the addressbook example, you
will see that there is a prepaddressbookform() function. This is called right after loading the form. It sets up the references
for the events. You would need to do this for any form that has events. You can also add event handlers in this function. For
example, a handler for the form.onsave event for doing validations and calculations prior to saving. Return .false from the event
handler to cancel the save. The onnewrecord event of the form can be used for creating constant values. If you want to implement a
form-level calculation that is displayed when a record is selected, see the onselect event of the dataform1.> 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 function
>
> Then 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 function
>
> So 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.Can you tell me where in the docs you sae that? I need to change it. It is in the appframework.sml, in the appframework.sma file.
Ciao, Neil
March 28, 2012 at 4:23 pm #1914JD 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.
March 29, 2012 at 6:22 pm #1590MichaelKeymasterOn 28/03/2012 17:23, JDK wrote:
> lookup()
>
> Tools for Converting SBL to SIMPOL Chapter 20. Moving from SBL to SIMPOL
>
> in 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":Sorry about that, but they do cover different things. Just as with the older Superbase version 2.0, and even Superbase 95/3.x,
there were different books covering specific areas.> SIMPOL IDE Doc SIMPOL IDE Tutorial SIMPOL Language Ref SIMPOL Programming Guide SIMPOL Quick Start Guide SIMPOL Personal User
> Guide
>
> With 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.Well, to some degree, it depends on what you are looking for. Also, the huge document you haven't even mentioned is the massive
library of source code, including the implementations of dataform1 and the appframework. In some cases, the fastest way to find
something out in terms of how thigns work is to look at the source code.> On that note, why can't I get to Personal from a menu pick in the IDE.
It is worth considering adding a call to start Personal from the IDE menu, as well as firing up the various documents from the
Help menu.Ciao, Neil
- AuthorPosts
- You must be logged in to reply to this topic.