Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A simple Prompting ww.prg Which help a lot other than de
Message
From
04/03/1998 11:11:07
 
 
To
04/03/1998 05:11:52
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00082427
Message ID:
00082501
Views:
28
>>I have write the following code, to simple save as ww.prg
>>Then, you generate can use it in most data type!! ^_^'
>>
>>LPARAMETERS MSG1, MSG2, MSG3, MSG4, MSG5, MSG6, MSG7
>>LOCAL OUTPUT, SEMIMSG  && Semimsg is to transform the parameter to 'C'
>>
>>OUTPUT = ""
>>FOR X = 1 TO PCOUNT()
>>  IF X > 1
>>    OUTPUT = OUTPUT + CHR(13)
>>  ENDIF
>>  SEMIMSG = EVAL('MSG'+ALLTRIM(STR(X)))
>>  DO CASE
>>    CASE TYPE("SEMIMSG") == "N"	OR TYPE("SEMIMSG") == "Y"
>>        * CHANGE NUMBER TO STRING
>>	SEMIMSG = ALLTRIM(STR(SEMIMSG))
>>    CASE TYPE("SEMIMSG") == "D" && CHANGE DATE TO STRING
>>	SEMIMSG = ALLTRIM(DTOC(SEMIMSG))
>>    CASE TYPE("SEMIMSG") == "T"	&& CHANGE TIME TO STRING
>>	SEMIMSG = ALLTRIM(TTOC(SEMIMSG))
>>    CASE TYPE("SEMIMSG") == "O"	&& CHANGE OBJECT TO STRING
>>	SEMIMSG = "NAME: " +ALLTRIM(SEMIMSG.NAME) + CHR(9) + ;
>>        SEMIMSG = SEMIMSG + "CLASS: " + ALLTRIM(SEMIMSG.CLASS)
>>  ENDCASE
>>	
>>  OUTPUT = OUTPUT + ALLTRIM(STR(X)) + ":" + CHR(9) + SEMIMSG
>>ENDFOR
>>
>>IF !EMPTY(OUTPUT)
>>  WAIT "&OUTPUT" WINDOW NOWAIT
>>ELSE
>>  WAIT "Nothing Here" WINDOW NOWAIT
>>ENDIF
>>
>>As passing parameter is max. 27!
>>if possible to use array in passing, then help a lot!
>>Because Tray program by debug bit-by-bit is quite time-waste!
>>
>>So, Pls help me on handling Array!!
>>Thanks!!
>So you want the array version ? OK here it's with some modification to code :
>>
>oTestObj=createobject("Form")
>dimension aMsgElems[6]
>aMsgElems[1] = "Hello"
>aMsgElems[2] = {01/01/1998}
>aMsgElems[3] = 987
>aMsgElems[4] = oTestObj
>aMsgElems[5] = {01/01/1998 10:02}
>msgVal=DisplayMsg(@aMsgElems, 67, "Test message")
>oTestObj.release
>? msgVal
>
>function DisplayMsg
>LPARAMETERS aMsgElems, nDialogBoxType , cTitleBarText
>LOCAL ix,OUTPUT, SEMIMSG  && Semimsg is to transform the parameter to 'C'
>OUTPUT = ""
>nArrayLen = alen(aMsgElems,1)
>FOR iX = 1 TO nArrayLen
>  DO CASE
>    CASE TYPE("aMsgElems[ix]") $ "NY"
>        * CHANGE NUMBER TO STRING
>        SEMIMSG = ALLTRIM(STR(aMsgElems[ix]))
>    CASE TYPE("aMsgElems[ix]") $ "D" && CHANGE DATE TO STRING
>		SEMIMSG = ALLTRIM(DTOC(aMsgElems[ix]))
>    CASE TYPE("aMsgElems[ix]") $ "T"	&& CHANGE TIME TO STRING
>		SEMIMSG = ALLTRIM(TTOC(aMsgElems[ix]))
>    CASE TYPE("aMsgElems[ix]") $ "O"	&& CHANGE OBJECT TO STRING
>		SEMIMSG = "NAME: " +ALLTRIM(aMsgElems[ix].NAME) + CHR(9) + ;
>                  "CLASS: " + ALLTRIM(aMsgElems[ix].CLASS)
>    CASE TYPE("aMsgElems[ix]") $ "L"
>        SEMIMSG = iif(aMsgElems[ix],"True","False")
>    OTHERWISE
>        SEMIMSG = ALLTRIM(aMsgElems[ix])
>  ENDCASE
>  OUTPUT = OUTPUT + ALLTRIM(STR(iX)) + ":" + CHR(9) + SEMIMSG + ;
>           iif(ix<nArrayLen,chr(13),"")
>ENDFOR
>
>do case
>    case parameters() < 2
>         return messagebox(output)
>    case parameters() < 3
>         return messagebox(output, nDialogBoxType)
>    otherwise
>         return messagebox(output, nDialogBoxType , cTitleBarText)
>endcase
>
>Cetin

;D======== Great Thanks! I forgot Logic, Currency, Memo, Array, General...
My coding technique really need great improve. ~_~'

With this small program, More Convience to test some Values but no need to
take care the type!
Because in begining, I fail to get the number Value as macros DO NOT sub on it!
So, I always need to type =messageb(allt(str(nVariable))).... Quite poor...
But I still suggest to use a short name 'ww.prg' because
'ww' means Wait...Window [NoClear| Timeout| NoWait....]
call it with very simple code:
ww(dBrithDay, tNow, nLen * thisform.width,..)
Of cos, if using Array passing, no need to handle the parameter list...
but add them to array before passing! ^_^"

To fasten debug the program, really need a good debugger and easy way to
give data value on running!
Finally, I just ask, is it hard to code the memo into it??
Will it cause Length problem and cut shorter?? but seldom involve Memo on
coding, most likely are number, character and datetime or object!
maybe use:
CASE TYPE("aMsgElems[ix]") $ "M" && CHANGE memo TO STRING
Dimension output2[memlines[aMsgElems[ix]]]
for iy = 1 to memlines[aMsgElems[ix]]
  output2[iy]=mline(aMsgElems[ix],iy)
EndFor
* Sth like that to cut them into some single array and put them out again!
* ^_^" Great Learn, of cos some bugs may find...
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform