Forum Replies Created

Page 2 of 3
  • Paul Mulroney

    Member
    February 17, 2021 at 8:46 am in reply to: Dynamic server port

    I don’t think so. Is there a reason why you’re not assigning a port number? You could pick a known value, then there wouldn’t be any issues.
    We had some code that would dynamically set the server port, but only after it determined that the port wasn’t already in use. This would prevent Omnis from hanging on startup waiting for the port to become available.
    Regards,
    Paul.

  • Paul Mulroney

    Member
    February 17, 2021 at 8:38 am in reply to: Creating a drag rectangle on the thick client

    OK, so I worked out something that works for us.
    You can create a shape object, with these properties

    • $backpattern: kPatTranparent
    • $bordercolor: something bright eg kYellow
    • $linestyle: something obvious eg Line: 2
    • $shape: kRect3D
    • $effect: kBorderPlain

    In $construct of the window:
    Set reference irBox to $cwind.$objs.objBounds ;; Make this a shortcut to access the shape object
    When we want to enable the shape object, we have a button to enable it with this code:
    Calculate irBox.$selected as kTrue ;; Enable selection handles
    When we save the record, capture the following:

    • irBox.$top
    • irBox.$left
    • irBox.$width
    • irBox.$height

    Don’t forget to disable selection:
    Calculate irBox.$selected as kFalse ;; Disable selection handles
    It’s a little clunky, but it serves our purpose. Maybe others will find this useful!

  • Paul Mulroney

    Member
    September 17, 2020 at 1:47 am in reply to: try catch block

    Hi Scott,
    It’s not ideal, but how about “Load Error Handler”? eg
    Load error handler ccPWM/ErrorHandler (first error, last error)
    After that have your code. If you want to catch OS level events like timeouts etc, it should happen automatically. If you want to create your own custom errors, you can eg
    Signal error {27,"Something bad happened, Err 27"}
    When done,
    Unload error handler ccPWM/ErrorHandler
    In your error handler, you can then take whatever action necessary, and include eg
    SEA continue execution
    You can test the #ERRCODE and #ERRTEXT for specific errors eg
    Switch #ERRCODE
    Case 27
    ; Our special error signal
    Case kerrBadnotation
    ; Notation error
    Case kerrDiskfull
    ; OS file ops related
    Default
    ; All other cases here
    End Switch
    SEA continue execution
    Hope this helps!
    Regards,
    Paul.

  • Paul Mulroney

    Member
    April 28, 2020 at 3:30 am in reply to:

    Hi Jim,
    No I didn’t get an answer on this. We’re living with chunky courier for now, figuring out a workaround for it.
    Regards,
    Paul.

  • Paul Mulroney

    Member
    April 17, 2020 at 1:56 am in reply to: IOS Dev : is it possible to Include AR Kit

    Hi Rainer,
    With the latest versions of the App Wrapper, there’s now a SDK that allows you to make calls into/out of Omnis to other platform specific features. So, it should be possible to use AR-Kit and Cam with Omnis. You’ll need to write some iOS code to act as an interface between Omnis and these frameworks, but after that you should be OK.
    We haven’t done this yet ourselves, but we were looking into Machine Learning and wanted to use some of Google’s frameworks to do specific OCR functions that would be used inside Omnis.
    The new SDK opens a world of possibilities …
    Regards,
    Paul.

  • Paul Mulroney

    Member
    April 17, 2020 at 1:39 am in reply to: WIndows 64-bit Runtime Omnis 10.1

    Hi Scott,
    Thanks for your message.

    so every windows users on a the workstation your omnis app copies the entire contents of AppData/Local from the server?

    To clarify, Omnis copies everything from the firstruninstall folder into the user’s local app data. Once that’s copied over (and that’s a one-time thing, when the app is first launched in the user’s profile), our software then copies our libraries from the server into the local app data > omnis > startup folder. That process is a lot faster than the first copy, and they’re really the only components that change.
    There’s no workaround for copying into the user’s app data folder, except to make the Program Files folder writable, and that’s frowned upon by Microsoft. If you make the program files > omnis folder writable, then you can do away with the firstruninstall folder, put everything in the Omnis application tree like we used to do prior to UAC, and you get the desired result – one set of libs for all users on a workstation. Not sure how that will work in Windows 10, we stopped doing that since Windows 7 was first introduced.

    May I also ask which version of $O you are using?

    We’re currently using Studio 8.1, but we’re working to update our clients to 10.1. We still have some clients using O$ 5.2, so it’s a bit of mix of versions right now. The same principles work on all versions.
    Regards,
    Paul.

  • Paul Mulroney

    Member
    April 16, 2020 at 1:23 am in reply to: WIndows 64-bit Runtime Omnis 10.1

    Hi Scott,
    When we deploy to businesses, they typically have a server, and we have either Postgres or the Omnis Databridge installed on that server. Each workstation has a config file that points to the database. We set it up as an INI file, so we can have other parameters including the location of the LANUpdates folder. When they first run the software in their user profile, it will ask them where the LANUpdates folder is. When they locate it, it copies all the other parameters like database connection details etc to the user’s AppData folder. Once they have the connection details, it can then query the database for the latest version and download the updated libs to their profile.
    If you don’t have any kind of central server, but you want the software to be same across profiles on the workstation, perhaps you can use a central location such as the “Program Data” folder? The local app data profile still has some Omnis components, but you could have a “startup library” that points to the actual libraries in the Program Data folder, so that all profiles access the same libs.
    Regards,
    Paul.

  • Paul Mulroney

    Member
    April 15, 2020 at 1:52 am in reply to: WIndows 64-bit Runtime Omnis 10.1

    Hi Scott,
    I’ll say “me too” – we’ve had the same issue. First time you launch the app for a user, it seems to take a long time and there’s no visible indicator to the user that anything is happening. Sometimes we’ve had users try to launch twice, and then we get weird errors about “file already exists”.
    We have our libraries etc setup in the firstruninstall folder for the app, but we also make sure that it can handle it’s own update the first time the app launches. For example, if you add a new user to the machine after a long period of time (and a few updates!) you want to make sure that your libs in the firstruninstall can be updated automatically without falling in a heap. For our system, we have “LAN Updates” folder on the client’s server, and the app can check the contents of the folder and install updates before proceeding.
    Hope this helps!
    Regards,
    paul.

  • Paul Mulroney

    Member
    January 30, 2020 at 8:42 am in reply to: Simple problem but i can’t solve it.

    Hi Mimmo,
    If you need to create the file, then you need to swap $openfile() for $createfile()
    $openfile() will open an existing file, but it won’t create a new file. if you pass kTrue as the second parameter, it will open the file read-only and you will not be able to write to it.
    It’s probably a good idea to test the lError between each line of code as it executes, you can check to see if the command fails.
    So, your code should look something like this:

    Do FileOps.$Converthfspathtoposixpath(lName,lposxfile)
    If lposxfile=”
    OK message {Could not convert file path [lName]}
    Else
    Do lFileOps.$createfile(lposxfile) Returns lError
    If not(lError)
    OK message {Could not create [lposxfile]}
    Else
    Do lFileOps.$Writecharacter(kUniTypeAnsiLatin1,lritorno) Returns lError
    If not(lError)
    OK message {Could not write to the file [lName]}
    End If
    Do lFileOps.$closefile()
    End If
    End If

  • Paul Mulroney

    Member
    January 20, 2020 at 8:45 am in reply to: JSclient Printing

    (disclaimer: I haven’t tried this, but I’ve done something similar a long time ago)
    You could try:
    begin print job
    set report name <report #1>
    <print report #1>
    set report name <report #2>
    <print report #2>
    set report name <report #3>
    <print report #3>
    end print job
    That’s how you could treat three Omnis reports as one print job. I’m assuming that it will just keep appending into the PDF file.
    Regards,
    Paul.

  • Paul Mulroney

    Member
    January 20, 2020 at 8:38 am in reply to: A lot of “Obsolete Command”.

    Obsolete commands usually means that in some future version it will no longer exist. This is a warning – you should replace these commands with more modern equivalents.
    We had similar issues with other commands with an old Studio 6.1 app. When it moved to 10.1, suddenly it stopped working properly, because “Set return value” (which was a holdover from Omnis 7 days), was flagged as obsolete command for all versions of Omnis Studio, was now completely removed, and in Studio 10 it was commented out in the code. We had to do a quick edit and replace it with a “quit method returns <value>” instead. We were lucky it only appeared 162 times in the code 🙂
    Moral of the story: replace the obsolete commands at your leisure now, and save the heartache when you upgrade and suddenly find they have been completely removed!
    Regards,
    Paul

  • Paul Mulroney

    Member
    January 20, 2020 at 8:26 am in reply to: Custom OK Message Window

    You’re welcome!

  • Paul Mulroney

    Member
    January 20, 2020 at 8:07 am in reply to: Simple problem but i can’t solve it.

    For Omnis Studio 8.0 and above, you need to use POSIX style pathnames, which means that:
    Macintosh HD:users:administrator:desktop:nomefile.txt
    becomes
    /Volumes/Macintosh HD/Users/administrator/Desktop/nomefile.txt
    You can use the FileOps.$converthfspathtoposixpath() function to convert if you’d prefer.

  • Paul Mulroney

    Member
    November 13, 2019 at 1:03 am in reply to: Custom OK Message Window

    This is definitely possible!
    You need to have something like this in the $construct:
    enter data
    if flag true
    ; user has clicked OK
    else
    ; user has clicked cancel
    end if
    do $cwind().$close
    quit method <some result>
    You should have an OK button with the $buttonmode set to kBMok, and a cancel button with the $buttonmode set to kBMcancel
    The window should have the $modelessdata set to false – you want the window to only be enterable while the enter data command is in effect.
    Note that there are some differences between a true OK message and one that we create:
    – A true OK message will stop ALL execution of ALL code. There is absolutely nothing that I’m aware of that will do the same for us.
    – It WILL stop the currently executing method, but it won’t stop events from occurring, so you can trap events, or have timer objects fire etc.
    Hope this helps!
    Regards,
    Paul.

  • Paul Mulroney

    Member
    May 1, 2019 at 12:17 am in reply to: Subform Set Panels

    Hi Coralie
    We hit the same issue. You need to remove the subform set when you’re done. We have a “done” button on the subform set, so when the user clicks the button it calls this:
    Do $ctask.trSubForm.$RemoveSFS()
    In the main form that created the subform, we have this method: $RemoveSFS() which does this:
    ; Remove the subform from the subformset. This is called from the jsContractItemEntry subform
    Calculate vsSetName as 'ContractItemEntry'
    Calculate vnID as 1 ;; 1=jsContractItemEntry subform
    Do $cinst.$clientcommand('subformset_formremove',row(vsSetName,vnID))
    Quit method

Page 2 of 3