ume_hhgu_0506.doc saved at 20060821 16:37 1 / 8
Transcription
ume_hhgu_0506.doc saved at 20060821 16:37 1 / 8
ume_hhgu_0506.doc saved at 20060821 16:37 compiled from the news of www.webinacan.com/turf by Uli Merkel 1/8 From the editor................................................................................................................................................ 1 How to read a text file(ASCII) in Uniface? .................................................................................................... 1 Error while importing .exp file........................................................................................................................ 2 Function which stores the last structure editor function.................................................................................. 2 Asynchronous interupt trigger......................................................................................................................... 3 Grid-Widget with hidden fields....................................................................................................................... 3 selectdb behind a read builds a complete hitlist .............................................................................................. 4 Cannot print Uniface font 4 character ............................................................................................................. 5 Accept overides LMO ..................................................................................................................................... 5 Crypt .asn file .................................................................................................................................................. 6 Swapping databases with 8401 ....................................................................................................................... 7 Implicit commits with sql statements.............................................................................................................. 7 Uniface + xml, retrieve/reconnect (7.2.06, patch w2kz049/ w2kz048 ).......................................................... 8 From the editor Hello TURF-users, the first reply was encouraging enough to compile again. There have not so many helpdesk-problems reported to be solved, so it took some time to get a proper pile of topics. Please give me your feedback if it is woth to continue this, Uli How to read a text file(ASCII) in Uniface? yash_2707 File is generated from non-uniface system suppose MANRECS.txt. This will be renamed to 'MANRCES.YYYYMMDDHHMM' to reflect the date of the transactions lines in it. Now, this is to be uploaded in uniface. How do we read this file sequentially and also need to know the table name that would be use in Uniface alongwith the fields in it. (Because the file to be uploaded will not have a constant name as mentioned above.). joerg I suppose, the only way to upload the file is the fileload command (espacially because you use variable filenames). After a fileload the complete content of the file is in a variable or field. fileload{/image | /raw | /web} FileName, Target You can search for carriage returns (%%^) to seperate your data. petemonk Be careful with fileload as ther is a limit to the number of chars that can be loaded(65536). Maybe you would be better off using: lfileload {/web | /image | /raw} FilePath, Target I can't see that this has the same limitations Uli on $uuu, there is some sourcecode for a DLL which allows you to open a file and read ist line by line. http://uuu.teetzen.net/tools/file.html This does not request the memory to hold all the file (as fileload will do), but gives you´line-by-line info. .. and it is pretty fast too ... ume_hhgu_0506.doc saved at 20060821 16:37 compiled from the news of www.webinacan.com/turf by Uli Merkel 2/8 Error while importing .exp file simplutions When I tried importing .exp file from Uniface 8.2.03 to Uniface 7.2 version. I got the following error : 8066: Copy failed : Open error on input file/table. Do you have any idea why this error is coming up? What does the error 8066 means? joerg the error 8066 means that Uniface cannot find the file you want to import. Take a look at your ASN-File. Look where *.EXP-Files are saved. E.g: you want to import myfile.exp and in your ASN-Section files looks like this: [files] *.exp c:\mydir\exp\*.exp You have to copy the file in the directory c:\mydir\exp. Then you have to import the exp-file without "c:\mydir\exp\". You just have to import myfile.exp. Uli ... and by the way: There are a lot of differences in the repository of V8 and V7 of UNIFACE; therefore it is NOT possible to take just an exp from the higher version and load it to the lower one. You will find strange effects just as you can open a form, but you will get no data (due to read errors caused by "unknown" fields at the end of the record). So downgrading a UNIFACE application is a harder thing to do. simplutions I saved the the .exp file in the proper folder of the directory in C: drive. But, again it said Import failed : 6814. And in the error message same old - 8066 : Cannot copy a file/table. joerg as Uli said, you cannot import an export file from Uniface 8.2.03 to Uniface 7.2! Just the other way round makes sense -> from 7.2 to 8.2.03. martin ...also if you have .exp's mapped in your asn file, when importing, do not use the 'browse' feature, as putting in the full patch confuses Uniface. Instead, just type the name of the file (e.g. myfile.exp, not c:\folder\myfile.exp). If you do use the browse feature, remove the path to leave the filename. Alternatively, rename the file to .exp1 and you can then browse to it and use the full path Function which stores the last structure editor function pnprabhu27 Is there any function in Uniface 7.2 which stores the last structure editor function that was fired. e.g. ^QUIT, ^LAST_OCC, ^NEXT_OCC etc. martin There is a precompiler directive in uniface which tells you the trigger. At the start of each trigger, you could do ume_hhgu_0506.doc saved at 20060821 16:37 compiled from the news of www.webinacan.com/turf by Uli Merkel 3/8 $triggername$ = "<$trigger>" or $triggername$ = "<$triggerAbbr>" (I have no idea what the difference is) However, I'm not sure whether this will work in v7. I am testing in 8. Uli Unfortunately, there is no way to catch the last structure editor command. Because there are many ways to activate the structure editor (menu, panels, proc code, keyboard) there is little chance to intercept all the different activations by proc code. Just for curiosity: what do you want to achieve with this "last command" ?? Asynchronous interupt trigger petemonk On a form(PROGRESS) I have some code as follows, in which I am trying to set a timer. On the field gets focus trigger of the field called "timer" I set the Uniface internal timer as follows, where I try to send a message to the same form I am running and then try to stop the timer when my service has finished: newinstance "UTIMER",$timer$ activate $timer$.SETREPEAT(0) activate $timer$.SETMESSAGE("PROGRESS","check","") activate $timer$.SETMESSAGE("$net:JMSVCREP","check","") activate $timer$.START("00.00.01") ;every second activate "jmsvcrep".EXEC($$instancepath,$$username,$$ups_user_name ,SERVER_REPDIR ,$$svc_1,$$svc_2,$$svc_3,$$svc_4,$$svc_5,$$svc_6,$$svc_7,$$svc_8,$$svc_9) activate $timer$.STOP() On the asynchronous interrupt trigger of "PROGRESS" I have this code: if ($msgid = "check") timer.dummy = timer.dummy + 1s message "%%timer.dummy" show endif return(0) What happens is all the interrupts are stored up until the service is finished. Is there anyway of getting the field "timer" to display whilst the service is running? I've tried "show", but this has no effect! Uli UNIFACE collects all Asyncronous Interrupt Invocations in a queue. Only when UNIFACE returns to the Structure Editor (Dialog Mode) the trigger will be executed with all requests. To show your messages, activate an operation in your PROGRESS-form. Grid-Widget with hidden fields joerg I have a dummy entity painted on a form. Its property is Grid-Widget. There are 6 visible fields and 1 hidden field in it. When I retrieve the data from different entities the hidden field is filled with the key fields of ume_hhgu_0506.doc saved at 20060821 16:37 compiled from the news of www.webinacan.com/turf by Uli Merkel 4/8 read occ. When all data is retrieved and the form is active, the hidden field is visible! The content of the field is unvisible but the field itself is visible. Uniface 8.4.02.01 ( 1215_3) on W2K (Oracle DB on HP UX). martin. Could you use the format trigger to clear out the values in the columns that are to be hidden? Not ideal, but I don't think the grids are that friendly. joerg as I said, the field is visible but the content of the field is NOT visible. helveticus Fields that should not be displayed in a Grid should not be painted on the form. In case your "dummy" entity is defined as e.g. a non-database entity in the model then value of the "hidden" field should be available in proc and is not displayed as column in the Grid. It's currently not possible to either dynamically or hard coded hide a column in a Grid if the field is painted on the paint tableau. joerg thanks for your answer. I have found a workaround. I do not paint the hidden field, but use the $fieldproperties of a "normal" field instead to store the key of the occurrence. It is a trick Uli mentioned some time ago. Look at http://www.webinacan.com/turf/viewtopic.php?t=329. It works the same with $fieldproperties. Quote: It's currently not possible to either dynamically or hard coded hide a column in a Grid if the field is painted on the paint tableau. That means it is a Bug, isn't it? helveticus The Grid widget works according to its design specification and therefore this (of course) cannot be classified as bug. the Grid widget. But you could call it a "limitation" of the current version of Uli instead of using a $fieldproperties of a "normal" field, it would be more accurate to use $occproperties. This list is connected to the occurence of an entity, not to a defined field. joerg thanx for your tip. It works fine. selectdb behind a read builds a complete hitlist joerg I've found a funny feature: We have some components where we display many occs and the users want to see ume_hhgu_0506.doc Uli saved at 20060821 16:37 compiled from the news of www.webinacan.com/turf by Uli Merkel 5/8 it looks like UNIFACE treats a selectdb now as a concurrent access to the same entity, in which case the hitlist of the "open" cursor is completed at first. What about "lookup" instead of the selectdb before you do the first "retrieve"? $status will show the number of hits (unfortunately only of a "global" retrieve, not for a retrieve/e). joerg you are right, lookup is even better than selectdb, because you don't have to modify the profiles. Cannot print Uniface font 4 character petemonk I hope someone can help. On version 7 of uniface I could print the square root symbol in a field by having the code to do this in a trigger. This was possible in version 7 because the trigger editors are unifields, so you can type in characters in different Uniface fonts. However, in version 8 the triggers are edit boxes so this is not possible. Can anybody help? petemonk I've sorted this problem out now. I've defined a help message which still uses unifields and loaded this in using $text(MYMSG), a bit long winded I know, especially if you are using a lot of these special characters. Thanks to everyone for looking, martin if you have a lot of these special characters, why not just define one text message containing all of your special characters and then reference the individual characters using global constants e.g. your specialchars string may contain two values, your square root symbol and a hash. the constant "SQROOT" could be defined as 1:1 the constant "HASH" could be defined as 2:1 etc Then, you could simply use $text(specialchars)[SQROOT] or $text(specialchars)[HASH] petemonk I never thought of that, great idea. Accept overides LMO geoffwright When I press STORE and the validation in the LMO returns -1, no store occurs. When I press ACCEPT, the LMO goes straight into the ACCEPT trigger which tries to store, resulting in an error. Investigating this, a straight 8401 install works fine. As soon as I install patch D102 (to get around bug 25810 - long fields in boilerplates), this store problem occurs. ume_hhgu_0506.doc helveticus saved at 20060821 16:37 compiled from the news of www.webinacan.com/turf by Uli Merkel 6/8 The described problem sounds like bug 25876 "Problems with error triggers introduced in patches C206 and D101" that was fixed in D104 (and higher). But why are you using such an old version 8.4 patch level? I would advise you to install the latest available, which currently is 8.4.02 + D206. And in about 2 weeks the version 8.4.03 (Service Pack M421) will be released. geoffwright Many thanks, Daniel. I was looking for bugs to do with Accept or Store. Crypt .asn file Michel_33 I want to crypt an asn file, because in this file appears the user/password string to access to the database (in the [PATHS] section). In order to have more security i don't the users can connect directly tro the database withe database tools (actually it is an Access database). I someane have an idea to do this! Uli instead of holding the userid/password in the asn-file, you can define the databse-connect parameters with the "open" command inside of the UNIFACE application. You can either hardcode the user-info or store it wherever you like in a cryped file and acces it via file_load. P.S.: UNIFACE has/had a feature "PATHSCRAMBLER" to keep the logon-info of an ASN-file confidential. I do not know where it is documented. Uli Some more info an the pathscrambler and how to use it: Quote: Betrifft:Re: [U-L] Pathscrambler crashes I've got the same problem. Solution is a bit tricky: As the hotline told me ages ago, it depends on the Uniface-Cd-burned-Version. If you have an early uniface-CD-Version 7.2.06, the pathscrambler will crash. Just ask for a new pathscrambler from the hotline. this worked fine. > > <[email protected]> schrieb im Newsbeitrag > > on NT, to try : > > c: > > cd c:\unif726\bin > > pathscrambler.exe -asn=c:\unif726\usys\myfile.asn > > It works OK for me: > pathscrambler.exe -asn=M:\Discos7\qwas.asn > Created: M:\Discos7\qwas.asn.enc Michel_33 I tried open and in the .asn no password, it works very well thanks a lot for your response ume_hhgu_0506.doc saved at 20060821 16:37 compiled from the news of www.webinacan.com/turf by Uli Merkel 7/8 Swapping databases with 8401 geoffwri ght I have multiple oracle databases defined under different users with the first defined thus $DATA ORA:instance|login|password when I try to swap user with a close and open close "$DATA" open "instance|user2|password2","$DATA" it returns zero $status but doesnt swap user. When I define it as $DATA ORA:instance|?|? and hard-code an initial oracle login|password into the startup shell it swaps fine. It also does the same on 7206 and 8401 using MSS. (I have seen bug 26042 is similar). Anyone seen/solved this? Is it a bug? Uli Uniface uses at first the data from the ASN and adds then the parameter of your open statement. This is exactly the documented behaviour and you have already found what you have to change in the ASN to allow flexible open parameters. geoffwri ght Thanks for that, Uli, Does that mean I cannot define $DATA ORA:instance|login|password in the assignment file and after logon, swap to login2|password2 using open "instance|login2|password2",$data Uli Yes, if you fix the parameters in the ASN, they are fixed. BUT: you can place [logicals] in the ASN-file and use these in your OPEN. geoffwri ght I eventually defined a default login as below, after which I can swap oracle instances as I need with open and close. $DATA ORA:?|?|? [LOGICALS] SERVER=ora1.machinename.local NET_PATH=$DATA INIT_LOG=login INIT_PASS=password Implicit commits with sql statements emmalou It is my understanding that Uniface does not want a commit statement when using a sql statement because it confuses Uniface. My question is, does Uniface treat each sql statement as a seperate transaction and commit each transaction as its ran or will it commit any uncommited transactions? Example creocc "test_table" a.test_table = 1 store/e "test_table" sql "update test_table_2 set b = 2","SYB" What is committed at this point? Both the store and the sql statement or just the sql statment? ume_hhgu_0506.doc Uli saved at 20060821 16:37 compiled from the news of www.webinacan.com/turf by Uli Merkel 8/8 UNIFACE does NOT have implicit commits; you have to commit by yourself. The "problem" with the SQL command is that you may have 2 different SQL working areas and a commit may not be recognized properly in both worlds. This may result in lost cursors etc. Uniface + xml, retrieve/reconnect (7.2.06, patch w2kz049/ w2kz048 ) sirius2000 Posted: 11.07.05 06:32 Post subject: Uniface + xml, retrieve/reconnect I was just wondering if you would be able to assist me. I am currently developing in V7.2.06 of UNIFACE and have just started looking into XML streams. I noticed that in V8 the retrieve/reconnect has a possible status value of "mod" that is not documented in V7.2.06. Can anyone tell me anything about this additional status and why it was added? Was there a problem with the statement in V7? In my testing I seem to be unable to load a modified occ (ie occurrence that has had data changed saved to an xml stream with a status of "est" - it doesn't merge the change data in the stream to the db record)? I am wondering if I am just doing something wrong or if this was actually a problem in V7? This is what I am doing: I have a form "xml_1" where I retrieve the entity. There is only one occurrence. I then modify one of the field values, say from "test string" to "changed data". Then I save the one occurrence to an XML stream. I clear the occurrence in "xml_1". Then I pass the stream to a 2nd form "xml_2". In "xml_2" I load the xml stream. I retrieve/reconnect. The data from the stream is then overwritten with the data in the database. Is this right? My understanding is that the database occurrence should be retrieved and merged with any changed data from the stream. So this should result with the field value = "changed data"??? Uli Posted: 12.07.05 06:07 Post subject: With patch w2kz049 installed retrieve/reconnect doesn't work. you have to come back to W2KZ048. ("Ezio" <[email protected]>) sirius2000Posted: 12.07.05 06:29 Post subject: I had to install the previous patch and it works now (as mentioned in the reply).