Is there a technique I can use to make information from an element seem just like Sbasic code that can be used in sbasic?
I use command buttons to send emails and faxes. Inside the sbasic code I create variables for the Subject, To, from, body and attachment that are then used with the @SendMail command.
I needed a way to allow a user to modify some of those particulars without having to wait for me to make a change and recompile.
So I created a new Database in the app that has just 5 fields. Key, From, subject, Body and attachment. My intent was to simply use @XLookupSourceList to create my variables that then can be changed by a user going to the specific record that matches the button and change anything they wanted all on their own.
var vVals as String
vVals = @XLookupSourceList(@Fn, "code1", "EmailStructure!Key", "EmailStructure_Sender;EmailStructure_Subject;EmailStructure_Attachment;EmailStr ucture_Body") if not @Error {
VFromEmail = @AccessStringArray(vVals, 1) Vsubject = @AccessStringArray(vVals, 2) Vattachment = @AccessStringArray(vVals, 3) Vbody = @AccessStringArray(vVals, 4)
}
else { @MsgBox("Error: Unable to get email info.", "", "") }
Now when I did this my VFromEmail and Vsubject worked as thought but my Vbody came across in email as literally as it was typed, not as Sbasic usually interprets it.
So for example this code in Sbasic used with @sendmail makes the email body with the element of the last name of a physician and then the sentences
Vbody = "Dr. " + OATstudy_Last + "," + @NewLine() + @NewLine() + "yada yada yada." + @NewLine() + @NewLine() + yada yada yada" + @NewLine() + @NewLine() + "yada yada yada" + @NewLine() + @NewLine() + "yada yada yada"
Now when I place this exact text in either a text element or a text editor element and use the @XLookupSourceList Vbody = @AccessStringArray(vVals, 4)
it comes out in the email literaly as is not as interpreted by Sbasic. Is there a different way I can do this?
Thanks
|