T.R | Title | User | Personal Name | Date | Lines |
---|
3609.2 | | GIDDAY::JOYCE | Okay, who moved the goalposts? | Thu Dec 09 1993 23:54 | 20 |
|
Seriously, try something like...
;;OA$_MO_SEND;;
GET #BLOCKS = FILE$.BLOCK_SIZE[OA$CURMES_FILE]\
COMPUTE #COST = #BLOCKS * <cost_per_block> \
OA$FAO "This message is !AS blocks and will cost !AS dollars - send it ? "
"#PROMPT",#BLOCKS,#COST \
YESNO_PROMPT #PROMPT\
OA$FLD_STAY\
.IF OA$PROMPT_TEXT = OA$Y THEN MAIL SEND
ELSE DISPLAY("Message not sent")
I haven't tested this and of course there are lot's of ways to send
mail from ALL-IN-1 so you'd have to change all of them. Maybe you
should just implement a "Check cost" option instead?
Andy
|
3609.3 | A suggestion to slightly improve on the code perhaps | GIDDAY::SETHI | Recompense injury with justice | Fri Dec 10 1993 00:34 | 18 |
| Hi Andy,
A slight correction, since I am in my nit picking mood :-).
>COMPUTE #COST = #BLOCKS * <cost_per_block> \
I would perhaps create a logical that would have the cost per block,
than do the following:
get oa$dcl='#cost_per_block=f$trnlnm("logical name")'
>COMPUTE #COST = #BLOCKS * #cost_per_block
So if the price does change you do not have to go around hacking the
code. As an alternative the cost could be setup in OAINI.SCP.
Regards,
Sunil
|
3609.4 | | GIDDAY::JOYCE | Okay, who moved the goalposts? | Fri Dec 10 1993 04:10 | 22 |
|
re .-1
>> get oa$dcl='#cost_per_block=f$trnlnm("logical name")'
>> >COMPUTE #COST = #BLOCKS * #cost_per_block
This won't work - you can't set up a #symbol from DCL like this.
You've also got a > when you should have a \
Try
GET #COST_PER_BLOCK = LOG$logical-name
\COMPUTE #COST = #BLOCKS * #COST_PER_BLOCK
Or better, create yourself a system-wide dataset with 1 record...
GET #COST_PER_BLOCK = SYSCOSTS.VALUE["COST_PER_BLOCK"]
\COMPUTE #COST = #BLOCKS * #COST_PER_BLOCK
There's numerous other ways to do it...
|