
Paul Mulroney Mulroney
Forum Replies Created
-
Paul Mulroney Mulroney
MemberApril 15, 2020 at 1:52 am in reply to: WIndows 64-bit Runtime Omnis 10.1Hi 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 Mulroney
MemberJanuary 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 -
(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. -
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 -
You’re welcome!
-
Paul Mulroney Mulroney
MemberJanuary 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. -
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. -
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
-
You need to do the following (assuming Studio 8.0 or higher):
Do $cdevice.$assign(kDevOmnisPDF) ;; Switch to the Omnis PDF device.
Calculate $prefs.$reportfile as ‘full path to PDF file’ ;; Omnis PDF uses the $prefs.$reportfile to determine where to write the PDF.
Print report -
We’re looking at the Studio 10 DML to SQL stuff, but there still seems to be a few issues. We’re working with tech support to get them resolved because we still have a few DML based clients that we’d like to get to PostgreSQL.
-
We’re looking at this for a jsClient project we’re doing for a client. I’m fairly sure it’s similar to the thick client.
-
Hi Everyone,
A quick update:
We’ve been able to get it working, using a HTTP Worker object, and a command line call to openSSL. There’s an Authorisation header that contains the URL of the request and a number of other fields. This is then signed using RSA-SHA1 and sent as part of the request.
This is our two lines of code that do the magic:
Calculate vsScript as con('cmd ',kDq,'/c ',kDq,kDq,isOpenSSLPath,kDq,' dgst -sha1 -sign ',kDq,vsKeyFile,kDq,' ',kDq,vsSrcFile,kDq,' | ',kDq,isOpenSSLPath,kDq,' base64 -A',kDq,kDq)
Launch program [vsScript] Returns vsSignature (Do not quit Omnis)
It basically does the following on the command line:
/path/to/openssl.exe dgst -sha1 -sign "/path/to/key/file" "/path/to/request" | "/path/to/openssl.exe" base64 -A
I don’t think this is a good long-term solution, because we’d be constantly opening a command window to run the signing/base64 conversion
I believe that Python has a lib that will allow us to do the same thing, but I have no idea how to call it from within Omnis.
Has anyone tried to sign something using RSA-SHA1 in Omnis? How do you do it?
Perhaps while you’re at EurOmnis, someone can figure out a quick and dirty hack for us!! -
Here’s another one:
There’s a problem with TCPPing on Studio 5.2, Mac OS Sierra and above – it always returns an error. I’ve created a workaround, and posted the code on GitHub.
NOTE: you don’t need to do this for Studio 8.0 and above, or for Windows/Linux, or for Mac OS before 10.12 (Sierra).
Here’s the link on Github: https://github.com/pmulroney/TCPPing_for_Studio5 -
Hi $All,
Here’s another one:
https://github.com/pmulroney/ListIntersect_for_Studio5
From the ReadMe:
ListIntersect
Omnis Lists are powerful constructs that allow us to manipulate data in memory. A common operation is selecting lines in the list, often based on another list. A fairly simple way to do this would be to have two nested loop operations like the following pseudocode:For vList1.$line from 1 to vList1.$linecount step 1
For vList2.$line from 1 to vList2.$linecount step 1
If vList1.field=vList2.field
Select list line(s) {#L}
End For
End ForFor this code, it executes the inner loop n x m times – where n = list 1 linecount, and m = list 2 linecount. If List 1 or List 2 are large, then you could be executing the inner loop millions of times, and take a significant amount of time to do so.
This is where the $ListIntersect() function comes in. This method has been written so that you only process the smallest list *once*, which results n a significant performance increase.
This is really cool, so if you’re going to pinch it, make sure you acknowledge us ok?
USAGE
oListInterection.$ListIntersect(plList1,plList2,psFieldname,psFieldtype)
IN:- plList1 – the larger of the two lists to process. It can have duplicate values in the column that you’re testing
- plList2 – the smaller of the two lists.
- psFieldname – the column name in the list that you’re comparing again
- psFieldtype – options are Char, Int, Num or Date.
OUT: All lines in list1 that exist in list2 will be selected in list1.
NOTE
Both lists will be sorted by the nominated field name.
The comparison column must be the same name/type in both lists.
EXAMPLE
See Example1 for a trivial example of this method in operation. For a given list of cities/states in Australia, only select lines for a number of cities
In our software we use it as part of our search filtering process for some reports.
AUTHORS
@pmulroney, submitted on behalf of Logical Developments
Contributing
1. Fork this repository
1. Add a branch for your feature
1. Add the feature and perform a new JSON export
1. Submit a pull request