Wednesday, July 21, 2010
JSON Conversions
Friday, July 9, 2010
Hyper Activity
Thursday, June 3, 2010
Sub Valued Level Prompting Details
How do you fixup the screen and do cross referencing and other validations when you use SUB.VALUE.PROMPTING on a SUB.MT500 screen?
Here is an example where we want to prompt for multiple file names and within each file for multiple item ids.
Remember to add right justified fields using the PWS screen in SCREEN.BUILD if you want the count of sub-valued items to line up nicely.
You can add logic to execute only at the sub-valued level by checking X_Data_2 for the FROM.SCROLL.MAINT flag.
*
2200* Before prompt logic for Item_Attachments
*
IF INDEX(Prompt.X_Data_2, 'FROM.SCROLL.MAINT', 1) > 0 THEN
* Handle inner event from SUB.VALUE.PROMPTING execution of SCROLL.MAINT
* Reset SIP.VAL.FILE to enable cross referencing
FILE.VALUE = FIELD(Prompt.Display_Text_2, ",", 2)
FILE.LIST = MAIL.FILE.File_Attachments
CURRENT.FILE = FILE.LIST<1,FILE.VALUE>
CALL GET.DB.FILE(SIP.VAL.FILE, CURRENT.FILE)
ERROR = 0
RETURN
END
* Handle MAILBOX.ATT prompt event
GOSUB 2210;* Fixup Prompt Label with SUB.VALUE level display text
* Setup XREF stuff
Prompt.Conversions_Edits = '0X':@SVM:Prompt.Conversions_Edits
* remove compiled edits to force recompile
Prompt.Conversions_Edits = FIELD(Prompt.Conversions_Edits,roiDataMark4,1)
CALL GET.DB.FILE(SIP.VAL.FILE, CURRENT.FILE)
CALL SUB.VALUE.PROMPTING(ANSWER,SUB.DATA,P.NBR,PMT,SAVE.FN,VALUE)
END
*
RETURN
If you want to fix up details like the screen labels and prompt text while at the sub-valued level you can do this sort thing:
*
2210* Display SubValue Level Label Text
*
SET.NBR = Prompt.Scroll_Field_Type[2,2]
LOCATE SET.NBR IN SCROLL.DATA<9,1> SETTING PRIMARY.IDX ELSE RETURN
PRIMARY.PMT.NBR = SCROLL.DATA<1,PRIMARY.IDX>
PRIMARY.PMT = PID(PRIMARY.PMT.NBR)
STARTING.ROW = PRIMARY.PMT<1,7>
HEAD.ROW = STARTING.ROW-1
DISP.MASK = "L#":Prompt.Display_Length
ID.LABEL = XLATE("DICT ":CURRENT.FILE, "F0", 61, "X")
IF ID.LABEL = "" THEN ID.LABEL = "Item Id"
LABEL.TEXT = FMT(P.NBR,"2\0R"):".":VALUE:' ':ID.LABEL
Prompt.Text = "Enter ":ID.LABEL
REDIS.MISC<10> = L(HEAD.ROW):C(PMT<1,6>):LABEL.TEXT DISP.MASK
PRINT REDIS.MISC<10>:
RETURN
For Validation after prompting you can check the X_DATA_2 flag again and if you are at the multi-valued level simply request a repaint with ERROR=1000, but at the sub-valued level actually carry out input validations programmatically. Remember that your sub-valued level validation logic is being called from SCROLL.MAINT so do not use ERROR codes like 200, 1000 as you would for SUB.MT500, simply 0 or 1.
*
3200* After prompt logic for Item_Attachments
*
IF INDEX(Prompt.X_Data_2, 'FROM.SCROLL.MAINT', 1) = 0 THEN
* Remove SV Label Text
REDIS.MISC<10> = ''
ERROR = 1000
END ELSE
IF NOT(SIPDATA) THEN RETURN
FILE.VALUE = FIELD(Prompt.Display_Text_2, ",", 2)
FILE.LIST = MAIL.FILE.File_Attachments
CURRENT.FILE = FILE.LIST<1,FILE.VALUE>
REC = XLATE(CURRENT.FILE, ANSWER, -1, 'X')
IF REC = '' THEN
* Message 502: %1 item %2 not on file
CALL SCREEN.MSG(GetMessageText(502,CURRENT.FILE:@VM:ANSWER,0):";H;#M446065")
ERROR = 1
END
END
RETURN
Monday, April 26, 2010
7.3 sp1 GA Cutoff Week
Wednesday, March 17, 2010
The Wonderful World of Wizards
Sunday, December 20, 2009
Twas The Night Before Cutoff
Twas The Night Before Cutoff
Twas the night before cutoff, when all through the house,
Not a programmer was keying, nor clicking their mouse.
The updates all filed into StarTeam with care,
In hopes that Seven_Three soon would be there.
Customers all nestled, snug in releases,
While palmtops and I-Phones sat dark in valises.
And Jimmy in his whites, and I in my cap,
Had just settled our brains for a long winter’s nap.
When out on the Net there arose such a clatter,
I sprang from my twitter to see what was the matter.
Away from my Windows I crept like a gnome,
Searched through my desktop and opened up Chrome.
The Graphic in the heading of the new-painted page
Gave mirth to results there listed by age.
When, what should appear down the page not too far,
But a Manage 2000 and 5 rating gold stars.
With data entry screens, so lively and quick,
I knew without thinking it started on PICK.
On UniData it thrives with GFE-free frames,
And whistles, and whirrs, and remembers their names
"Now Namer! now Schoolboy! now Farmboy and Widget!
On Motor Mouth! On Cheese Head! on Professor and Gidget!
To EDX, to SCREEN.BUILD, to BX REBUILD ALL
Now dot away! Dot away! Dot away all!"
The founder with his satchel all stuffed full of papers.
The performer and painter both cooking up capers.
The young black bird that had grown up so tall,
Leading us onward from the end of the hall.
As dry leaves that before the wild hurricane fly,
When they meet with an obstacle, mount to the sky.
So with hope of happy havens away they all flew,
Leaving a product full of toys, and Last Keys support too.
And then from the Palace, gave we measured lecture,
With summary and bullet of each treasured feature.
As I drew in my head, with my neck like a crane,
Down the cat-5 a new release came.
It spoke not a word, but went straight to its work,
And filled all the data, then re-painted with perk.
And laying a finger on top of my mouse,
I attached on my portal a jpg'ed house!
And then on a lark in a moment of need,
I dialed in from home to setup a Feed.
It summarized sales figures and displayed on my mobile,
It remembered my context and let me go global.
Saved out on disk, Install Shield's new folder,
Languishing there whilest the weather grows colder.
I heard it exclaim, ‘ere it shrank out of sight,
"Happy upgrade to all, and to all a good-night!"
- with inspiration from the Sniggletter
- and with apologies to Clement Clark Moore and Henry Livingston