Search results

  1. A

    How to deal with &GLOBAL-DEFINE in Non-Static values?

    Absolutely no problem selecting an index in a dynamic query. Taking one of your examples: DEFINE VARIABLE hQuery AS HANDLE NO-UNDO. DEFINE VARIABLE cWhere AS CHARACTER NO-UNDO. cWhere = "FOR EACH sltran NO-LOCK WHERE sltran.co-code = " + QUOTER(ledger.co-code)...
  2. A

    How to deal with &GLOBAL-DEFINE in Non-Static values?

    The thing to understand here is that your &GLOBAL and &IF statements are preprocessors, and are evaluated/expanded out at compile-time. So, in your first example: ---------------------- &GLOBAL-DEFINE last-value vdepo yvar = {&last-value}. zvar = {&last-value}. message vdepo yvar zvar...
  3. A

    Need to assign the preprocessor value at runtime

    If you want to use a where clause in a variable (and hence, configure a query at run-time) then it's compile-on-the-fly or dynamic queries only. No way around it - preprocessors are evaluated at compile-time and that's that! Dynamic queries are great! If you need any help with the code, just...
  4. A

    Need to assign the preprocessor value at runtime

    You can't! Preprocessors are evaluated at compile-time, end of story. If you're building a query clause based on user input, dynamic is the way to go. Why wouldn't you want to use dynamic queries? This is what they're there for. The only way you can use preprocessors at run-time is if you...
  5. A

    current sequence value.

    Use the metaschema to get the list of all sequences. Then use DYNAMIC-CURRENT-VALUE to get the current value of each sequence (this depends on your version). FOR EACH _sequence: DISPLAY DYNAMIC-CURRENT-VALUE(_sequence._seq-name,"_dictdb"). END.
  6. A

    Mappiing foreignFields with smartobjects

    Blimey - you'll have to bear with me on this one. We may need to bounce things back and forth until it all makes sense. I'm assuming that the customer window runs the order window. Don't really care what runs the customer window! And apologies if this is teaching you how to suck eggs - not...
  7. A

    Appserver Stop command - remote code in tight loop

    Well, that sort of works. I now have no startup proc, and I call a .p with the REPEAT remotely. Then I stop via Progress Explorer. The client is disconnected immediately. The appserver process carries on for approx 90 seconds, and then receives the stop request, resulting in the shutdown...
  8. A

    Appserver Stop command - remote code in tight loop

    Ah, interesting. At the moment, the startup procedure connects to the Sonic broker, and listens via the REPEAT block. Instead, we could have no startup procedure at all, and then call a simple .p which does the broker connect and the listen REPEAT via a script on the server. That way, we...
  9. A

    Mappiing foreignFields with smartobjects

    You're going to have to pass some handles around. Assuming that he Customer window runs the Order window, here's one easy way. 1. Customer window uses RUN wOrder.w PERSISTENT SET hOrderWindow. 2. Create a few procedure in wOrder.w called ipGetOrderSDOHandle (or whatever you want). One...
  10. A

    Appserver Stop command - remote code in tight loop

    Yeah, tried that. Doesn't seem to help!
  11. A

    Appserver Stop command - remote code in tight loop

    Hi Sunil, The appserver is running in state-free mode, so there is no disconnect procedure. I did look at using the shutdown procedure (setting a global shared variable, which is checked in the loop), but the shutdown procedure doesn't actually fire (got a logging message in there). I guess...
  12. A

    Mappiing foreignFields with smartobjects

    Ah, I see. Are you running one window from the other? Well, regardless, here is some code to establish the foreign fields, the data link, and open the child query. I'm assuming that you can get to the stage of having handles to both SDOs in one place. SDO1 is the Customer SDO, SDO2 is the...
  13. A

    Mappiing foreignFields with smartobjects

    Hi there! Although you can do this programatically, the standard method of mapping two SDOs together is to modify the data link between them. Right click on either SDO, choose "Smartlinks..." option, find the data link that joins the SDOs together (or create one if it's not there). Click...
  14. A

    Appserver Stop command - remote code in tight loop

    Hi there! We have an appserver process, which basically starts, and performs a tight loop (REPEAT block), which checks a Sonic queue for messages. If I then use asbman -stop (or use Progress Exploder), the process doesn't stop - it carries on looping. A -kill command will do the trick, but...
  15. A

    FOR EACH with EXCLUSIVE-LOCK means TABLE locking???

    YoChan, If your code is using well-scoped buffers, your FOR EACH...EXCLUSIVE will lock one record at a time. If your code allows the record scope of the buffer in the FOR EACH to expand, then you have a problem because the transaction will be active before the FOR EACH begins, resulting in...
  16. A

    appbuilder vs eclipse

    I'm also interested in people's opinions on this subject. In addition, does anyone do any SmartObject (ADM2) development via the eclipse ADE? Ta, Andy.
  17. A

    Trapping a record Lock in FOR EACH

    Well, you ARE using a lock in the example given. It's a SHARE-LOCK, which is the default if you don't specify one. Regardless, if you want to check on locking you need to use NO-WAIT, which means you need a FIND. So, I would change the code to something like: DEFINE BUFFER b-customer FOR...
  18. A

    Get Query-String of a Browse-Widget

    Hi Chris, If you used QUERY-PREPARE to set the where clause, you can use the PREPARE-STRING attribute: MESSAGE BROWSE brMyBrowse:QUERY:PREPARE-STRING VIEW-AS ALERT-BOX INFO BUTTONS OK. However, if you just used "OPEN QUERY" on a static query, this will return ?. I don't know a way...
  19. A

    Detecting which field was changed in PostTransVal

    Hi there! Two possible methods - find the before-image copy in the rowObjUpd table and compare to the updated copy, or use the ADM2's changedFields list. Both approaches work fine in postTransactionValidate (checked using v10.1A02). Here's some code demonstrating both approaches: DEFINE...
  20. A

    Procedure editor comes up after exit the db

    If you have a development licence installed (ie, one which supports running of procedure editor), and you run a session from an icon, the procedure editor will appear when your startup procedure (as defined in your icon/pf file with -p) closes. It's always been this way. The way to avoid this...
Back
Top