woensdag, mei 11, 2011

 

Now where was I before I was so rudely interrupted...

Assuming it is safe to do so again, I'd like to tell of a very useful function that I so wish I had back in the mists of time when it was all chained polyservers and client assignment files.

Try this:


putmess $assignments("FILES")


or


putmess $assignments("DRIVER_SETTINGS")


You get my drift.

Please note: NO BEARDS WERE HARMED TO MAKE THIS BLOG POST.

donderdag, november 30, 2006

 
More hidden talents

fieldsyntax ".<$entname>","YED,YPR,YDI"

Applies to all.

dinsdag, september 26, 2006

 

More hidden talents.

The humble dropdownlist can display thumbnail images! Just set the valrep representation as follows:


$valrep = "001=^U_UQTD_GPICKBUT·!Confused·;002=^U_FIELDUNDO·!Undo·;003=^I_SYNTAX·!Accept"


or even


$valrep(comb) = "001=@tresjolie.bmp·!Angelina·;002=@bgates.bmp·!Bill·;003=@pinguin.bmp·!Linus"


The images are scaled to font size. One could increase the number of lines, use a large font like MonoHuge and create really cool user logins.

vrijdag, september 08, 2006

 

No comment

Tip

The default syntax highlighting colors of the RTF might not suit you. You may prefer a smaller tabsize. You may find keyword completion a source of aggravation. You may want to hide some comments...? :/

Surcease of suffering is at hand.


[widgets]
RichEdit=urichedit(font=MonoMedium;procbox=on;keywordcompletion=off;undolevels=200)

[procbox]
tabsize = 2
text = 0,128,0
comment = 255,255,255
string = 255,128,0
register = 0,0,255
keyword = 255,0,255
type = 0,128,255
userdefined = 0,0,192

donderdag, september 07, 2006

 

Hidden talents

Richedit and other widgets have properties not mentioned in documentation or default usys.ini file.

Amongst others, undolevels is used for setting the number of times you can undo edits in the richedit widget:

RichEdit=urichedit(font=MonoMedium;procbox=on;undolevels=20)


Most widgets have the property dimmedbackcolor which prevents the text background being greyed when the field is dimmed, (if you like that sort of thing).

zaterdag, augustus 26, 2006

 

Glue factories.

Tip:

I mentioned in the previous example of using a language other than Uniface to decode some data. Uniface is a high level language but sometimes you need low level functionality. Luckily, Uniface is extremely good at call-outs. You could even embed and spawn some, say python (Dutch too, so it must be okay ;D):


if (runScript()="Goodbye Cruel World%%^")
apexit
endif
end

entry runScript
variables
any stdout
endvariables

filedump $script, "hello_world.py"
activate "SYSTEM".COMMANDOUT("pythonw hello_world.py",stdout)
$status = stdout

script:blockdata +
"""
This example doesn't do anything worthwhile
"""
#Yeah right
import icomp

#Do something
print "Goodbye Cruel World"
+
end


Unfortunately, you can't use string interpolation within blockdata segments but precompiler constants are substituted and you can pass arguments on the command line.

But why embed? Simple: All interface contracts are held internally and don't require negotiation exception handling.

donderdag, augustus 24, 2006

 

Object example.

The IDF default export file format is .trx rather than my personal preference .xml format. I can read xml, trx less so. It seems a trivial thing but it is something you can correct and it provides a nice excercise on hacking uniface besides. (Don't worry there is a less scary way too).

The 'Convert Data' utility is one of Uniface's best innovations and your friend whether you are loading and unloading test data, migrating data or just mucking about with Uniface internals.

Export UOBJ.TEXT using the IDF form or from the command line. You may notice that some of the object entries are not your own. One in particular looks like this (almost):

<UOBJ:UCSUB>S</UOBJ:UCSUB>
<UOBJ:UCLABEL>SYSTEM</UOBJ:UCLABEL>
<UOBJ:UCVAR>USYS</UOBJ:UCVAR>
<UOBJ:UCTYPE>S</UOBJ:UCTYPE>
<UOBJ:UCLASS>0</UOBJ:UCLASS>
<UOBJ:UCOBJECT><BIN>55555F534343495F444C4C3D1B55555F435553545F5....
49523D46</BIN></UOBJ:UCOBJECT>

I modified the object code so that I can import it in order to set a particular encoded Uniface internal. Decode or 'unhex' the string in your export file, using say java, python or a php script. All have 'bin2ascii' modules suitable for the purpose (but not perl). Take care to remove (and later replace) tags. As XML and TRX share the same number of characters they should be at the same offset, (but it doesn't really matter).

Once decoded, mine looks like this (without carriage returns):

UU_SCCI_DLL=·;UU_CUST_UUIMPO49=UUIMPO49·;UU_CUST_UUEXPO49=UUEXPO49·;
UU_CUST_UUCLUS49=UUCLUS49·;UU_DEFEXPORT=TRX·;UU_PERMISSION=0·;
UU_SCCI_AREA=·;UU_SCCI_LOG=·;UU_SCCI_PROJ=·;UU_SCCI_AUTO=F·;
UU_SCCI_CHGPATH=T·;UU_SCCI_CHGPROJ=T·;UU_SCCI_GETVERSION=0·;
UU_CLUSTERING=EXTN_CL=1·!·;EXTN_PR=·!·;EXTN_PO=.cmx·!·;EXTN_OP=1·!·;
SPEC_CL=1·!·;SPEC_PR=·!·;SPEC_PO=.sgx·!·;SPEC_OP=1·!·;CONC_CL=1·!·;
CONC_PR=·!·;CONC_PO=.amx·!·;APPL_CL=1·!·;APPL_PR=·!·;APPL_PO=.shx·!·;
EINT_CL=2·!·;EINT_PR=·!·;EINT_PO=.eix·!·;INTT_CL=2·!·;INTT_PR=·!·;
INTT_PO=.fix·!·;SYNT_CL=2·!·;SYNT_PR=·!·;SYNT_PO=.fsx·!·;LAYT_CL=2·!·;
LAYT_PR=·!·;LAYT_PO=.flx·!·;FLDT_CL=2·!·;FLDT_PR=·!·;FLDT_PO=.ftx·!·;
LIBR_CL=1·!·;LIBR_PR=·!·;LIBR_PO=.lbx·!·;LIBR_OP=0·!·;CPRC_CL=3·!·;CPRC_PR=·!·;
CPRC_PO=.prx·!·;INCL_CL=3·!·;INCL_PR=·!·;INCL_PO=.ipx·!·;DEVC_CL=3·!·;
DEVC_PR=·!·;DEVC_PO=.dtx·!·;TRAN_CL=3·!·;TRAN_PR=·!·;TRAN_PO=.ktx·!·;PANL_CL=3·!·;
PANL_PR=·!·;PANL_PO=.pnx·!·;MESG_CL=3·!·;MESG_PR=·!·;MESG_PO=.msx·!·;GLYP_CL=3·!·;
GLYP_PR=·!·;GLYP_PO=.glx·!·;MENU_CL=3·!·;MENU_PR=·!·;MENU_PO=.mnx·!·;GFMT_CL=3·!·;
GFMT_PR=·!·;GFMT_PO=.fmx·!·;LANS_CL=5·!·;LANS_PR=·!·;LANS_PO=.lnx·!·;CREG_CL=3·!·;
CREG_PR=·!·;CREG_PO=.vrx·!·;GCNT_CL=3·!·;GCNT_PR=·!·;GCNT_PO=.cnx·;
UU_BPA_CLUS=CLUS100=0·!·;PRE100=·!·;POST100=.vpx·!·;CHECK100=F·!·;CLUS101=0·!·;
PRE101=·!·;POST101=.npx·!·;CHECK101=F·!·;CLUS102=0·!·;PRE102=·!·;POST102=.pkx·!·;
CLUS103=0·!·;PRE103=·!·;POST103=.pkx·!·;CLUS104=1·!·;PRE104=·!·;POST104=.cpx·!·;
CLUS105=1·!·;PRE105=·!·;POST105=.orx·!·;ADDTPDIR=F

Interesting. The setting I'm after is UU_DEFEXPORT=TRX, change this to XML. Encode the string and replace in your UOBJ.XML. Reimport it using the convert data utility as before. Build your uobj.dol and check the export objects form in the IDF.

This page is powered by Blogger. Isn't yours?