Forum Replies Created
- AuthorPosts
Michael
KeymasterJim wrote:
> When I open a statusbar on my window, it is appearing in the middle
> of the window starting on the left border and extending halfway
> across the window, located about 1/3 of the way down from the top of
> the window.
>
> If the window is not resizeable, every window I open has the
> statusbar in that position.
>
> If I make the window resizeable, the moment I resize any window, the
> statusbar pops into place and any window opened after that time has
> the statusbar in the correct place.
>
> Appears to be an uninitialized variable problem in simpol.
>Actually, it is worse than that, it is a message handling problem in
wxWidgets. If you create the window invisible, attach the statusbar to
it, and then show it, does it still happen?Ciao, Neil
Michael
KeymasterJDK wrote:
> That worked. Surprisingly, a reinstall didn't work. I'd have
> thought that an install would delete the old registry keys.
>No, the installer doesn't even look in the HKEY_USER section. That gets
built for each user on the machine the first time you fire it up, by
retrieving data from HKEY_LOCAL_MACHINE. Also, that is where
user-specific customization is stored, and I don't think most people
would thank me if I trashed their customizations every time they
installed an update. Things like colors, tab widths, autosave info,
default project directory, etc.Ciao, Neil
Michael
KeymasterJim wrote:
> Neil Robinson wrote:
>
>> Wrong type is usually a bit miserable to track down. If it is being
>> missed by the IDE and compiler, then chances are that the error is
>> occurring when calling a function and in the process, passing the
>> wrong type. It is sometimes hard to see it. I know, I have done it
>> often enough myself. If you debug it, you should at least track
>> down where it is failing. Once there, check the parameters being
>> passed. Then check them again. One thing I have done more than once
>> was to pass a sysrgb object on a parameter list, rather than the
>> sysrgb.value. The other side was expecting an integer, but instead
>> it got an object of type sysrgb.
>
>> Hope this helps.
>
>> Ciao, Neil
>
> That was it. I had created my stub event handlers by copying/pasting
> from another section of my code and I copied/pasted menu event
> handlers, that take an argument of type wxmenuitem rather than the
> wxformcontrol that I needed.That will do it. Sometimes I use the same functions to do dual duty for
menus and toolbar icons, so then I declare the incoming parameter as:type(*) item
As long as I don't rely on that specific item for driving other code, it
doesn't matter, it is ignored anyway.Ciao, Neil
Michael
KeymasterJDK wrote:
> I had already restarted many times. What are the registry keys. The
> tool bar is there. I can turn it on an off. I can move it around.
> But it is empty.
>
> JDK
>
>
>
>> JDK wrote:
>>> So I seem to have lost the debug tools. The debug toolbar is
>>> there. But it's just blank. I can move the empty thing around.
>>> I can turn it on and off. But it has nothing in it?
>>>
>
> Neil Robinson wrote
>> That is very strange. So you can see the toolbar itself, but there
>> is nothing in it? My immediate thought is to do a restart and see
>> if it persists. If it does, it may be necessary to delete a set of
>> keys from the registry. Ciao, NeilMake sure all instances are closed. Then you delete the key plus the
entire subtree for HKEY_CURRENT_USERSoftwareSIMPOL and when you
restart, things should be okay again.Ciao, Neil
Michael
KeymasterJim wrote:
> Simpol threads are certainly simpler, but not quite as powerful. So
> far, on my form-based solution, threads are working fine. We'll see
> how it goes when I implement some of my jobs that run at specific
> times (time of day) and we'll see if everything is adequately
> serviced while one of those jobs is running.
Should be okay. See the timer.sml library (source included). I use it
quite regularly and reliably.Ciao, Neil
Michael
KeymasterJim wrote:
> Well, I did wind up implementing it as a hashed array. That works
> fine but isn't what I originally intended.
>
> The SBL code I provided essentially did the SBL analog of the C
> pointer organization:
>
> int foo int *bar
>
> bar = foo *foo = 3
>
> printf("%dn",foo)
>
> except, of course, that SBL would take the variable reference by
> name, rather than by an address pointer.
>
> Since simpol takes function references by name at runtime it seems to
> me that it could also easily take variable references by name at
> runtime. You have a symbol table someplace internally; you have to.
> The indirection by name just involves walking that symbol table to
> find the variable name, just as you walk a function symbol table to
> find a function.
>
> In my specific case, I have a config file (actually several config
> files) that are organized as keyword;value pairs. I have global
> variables that match the keywords, and assign the values to those
> variables which then are used effectively as constants throughout the
> program run.
>
> The path of least resistance turned out to be to define an array then
> load the array as array[keyword] = value.
>
> This worked fine, but there are cases where pointers are very nice.Actually, it isn't really an issue of pointers, since you basically have
that in SIMPOL. What you were looking for is a way to take a string
value and create a variable from it. The thing is, variable names are
not preserved through compilation. If, on the other hand, you had a huge
type and wanted to track down a matching property name for a given
string, that you could do.Ciao, Neil
Michael
KeymasterJim wrote:
> Duh. I guess you want the sbv file primarily. Not enough coffee
> this morning.
>Both would be nice. If the SBV requires tables, I will need whatever is
required to run the conversion. As for needing coffee, I am absolutely
trashed by a heavy cold/flu bug at the moment, so I am not getting
nearly as much time in right now as I normally manage.Ciao, Neil
Michael
KeymasterJim wrote:
> I have an error 17 (wrong type) coming out of wxprocess. This error
> message has no explanation in the docs, and is only happening on one
> form.
>
> All of my forms are straight translations of superbase .sbv files,
> accomplished with the provided tools.
>
> All forms go through the same startup procedure (using the same
> routines and a function reference to get the proper form), and all
> startup ends with the same wxprocess line.
>
> All forms work, save this one which bombs the whole program whenever
> any control other than a formedittext is clicked on.
>
> Compiler reports no errors or warnings.
>
> What is causing this?Wrong type is usually a bit miserable to track down. If it is being
missed by the IDE and compiler, then chances are that the error is
occurring when calling a function and in the process, passing the wrong
type. It is sometimes hard to see it. I know, I have done it often
enough myself. If you debug it, you should at least track down where it
is failing. Once there, check the parameters being passed. Then check
them again. One thing I have done more than once was to pass a sysrgb
object on a parameter list, rather than the sysrgb.value. The other side
was expecting an integer, but instead it got an object of type sysrgb.Hope this helps.
Ciao, Neil
Michael
KeymasterJim wrote:
> The new tool created a form that personal would open, for the form
> that had previously bombed, but I then tried to convert a different
> form and it bombed.
>
> First error from personal indicates that the <valueon> value
> </valueon> doesn't work if value contains an ampersand. I had
> <valueon> DP&L </valueon> which bombed with an error message
> "expecting a ;". This worked after I changed it by manually editing
> the XML file to remove the ampersand.
>
> After this manual edit, I tried again to load the xml file, and got
> the error message: "Element sdf1link does not carry attribute ID". I
> again looked at the xml and I have no idea what belongs there.
>
> However, this is what is there:
>
> <!ELEMENT sdf1link (sourcefield, sourcetable, targetfield,
> targettable, childlinks?, siblinglinks?)> <!ATTLIST sdf1link id CDATA
> #REQUIRED
>Can you send me the form file? I will have a look. It is not impossible
that the code that generates links is not as robust as the other bits.Ciao, Neil
Michael
KeymasterJim wrote:
> Neil Robinson wrote:
>
>> Create the bitmap first. But, please note that the graphic controls
>> are all lower in the z-order than any form control, including
>> bitmaps. So lines, rectangles, triangles, ellipses, and arcs will
>> all appear below the bitmap. Otherwise, z-order is control creation
>> order, with the first appearing at the bottom, and the others
>> appearing above it.
>
>> Ciao, Neil
>
> This is the kind of behavior I expected, but it doesn't seem to work.
> I create the bitmap first, and only a label appears above it.
> Command buttons appear below it. Now, command buttons are
> rectangles; are you telling me that these will never be above the
> bitmap???If you are using the wxgraphicrectangle, then they will always be
beneath all form controls. If, on the other hand, you are saying that
you are drawing wxformbutton objects over a wxformbitmap and they are
ending up below, that is a different thing altogether. Have you checked
to see if it is a refresh issue (move the window off the desktop and back)?Ciao, Neil
Michael
KeymasterJim wrote:
> Take a string of the format variable;value
>
> In SBL, I can separate this string, thus extracting both the variable
> name and the associated desired value, and I can then use indirection
> like this to assign the value to my actual variable in the program.
>
> kw$ = MID$ (a$,1,div%% – 1) kwval$ = MID$ (a$,div%% + 1,slen%% –
> div%%)
>
> kw$ = kw$ + "$" kw$$ = kwval$
>
> Now of course I can separate a string in simpol, but can I assign a
> value like this? How, syntactically, would I use indirection to
> achieve this result?
>I don't think it is possible to define a new variable at runtime. This
gets dealt with at compile time. Having said that, I have just about
never found a need for this approach in the past in my SIMPOL
programming. Take a step back and describe what this is trying to
accomplish. You may find that an array can do things for you that you
otherwise couldn't have done, for example.Ciao, Neil
Michael
Keymasteruser@domain.invalid wrote:
> I am impressed with the care you are taking to get detail blocks
> right. Detail blocks are *the* unique selling point of Superbase and
> could be the same for Simpol. It is important that you do it well!Thanks Philip,
I think that detail blocks done right could be a big selling point. I
just want to make sure that whatever design I finally settle on meets
the vast majority of people's needs. At the same time, it has to perform
at an acceptable speed, and it has to be doable. I am currently thinking
of implementing these in stages, where stage one may not include child
detail blocks. That way we can give a decent shakedown cruise to the new
design before complicating it even further.Ciao, Neil
Michael
KeymasterJim wrote:
> Neil Robinson wrote:
>
>> Jim wrote:
>>> of course, the fact that I will be using multiple threads is the
>>> reason I was asking about pass by value vs pass by reference.
>>>
>>> Is the taking of a lock guaranteed to be atomic, such that I
>>> can't get into a problem if two threads simultaneously try to
>>> take a lock (which potentially is possible on a multiprocessor
>>> system)? Low probability event, sure. But if it can happen, it
>>> will, and corrupting data is to be avoided at all costs.
>>>
>> SIMPOL's threading is implemented internally, not using system
>> threads. As such SIMPOL would handle the thread concurrency anyway,
>> but the call to the lock1 object's lock() function is atomic. Only
>> one will succeed.
>
>> Ciao, Neil
>
> Actually, I am a bit surprised you are not just putting a wrapper
> around pthreads.
>The reason for that is that our early experimentation with pthreads was
less than satisfactory, and we also found that pthreads were not a
guaranteed presence on any given Linux installation.Freeware products can get away with that (oh it doesn't work unless…),
but we can't.Ciao, Neil
Michael
KeymasterJim wrote:
> Neil Robinson wrote:
>
>> Jim wrote:
>>> of course, the fact that I will be using multiple threads is the
>>> reason I was asking about pass by value vs pass by reference.
>>>
>>> Is the taking of a lock guaranteed to be atomic, such that I
>>> can't get into a problem if two threads simultaneously try to
>>> take a lock (which potentially is possible on a multiprocessor
>>> system)? Low probability event, sure. But if it can happen, it
>>> will, and corrupting data is to be avoided at all costs.
>>>
>> SIMPOL's threading is implemented internally, not using system
>> threads. As such SIMPOL would handle the thread concurrency anyway,
>> but the call to the lock1 object's lock() function is atomic. Only
>> one will succeed.
>
>> Ciao, Neil
>
> Does that mean that a simpol application will not take advantage of
> multiple processors?
>A single SIMPOL process will only run on one CPU. If you design an
application that uses multiple programs, each will potentially run on a
separate CPU. This is the other side of our design decision about
ensuring that SIMPOL is multi-threaded even on systems that would not
provide a reliable threading library. There is some planning for
allowing SIMPOL programs to run other SIMPOL programs (without using
!execute() ) and in that case they might run on different CPUs.Ciao, Neil
Michael
KeymasterJim wrote:
> Any analog of this SBL requester?
>In uisyshelp.sml (see project source code), there is a function called
getuserinput() that has an optional parameter: passwordstyle.Ciao, Neil
- AuthorPosts