I'm trying out the datagrid for the first time. I want to display rows of numeric results and have encountered a trivial (I suspect) problem.
If I use the following lines of code to place two rows of data in my datagrid, I end up overwriting the first line with the second. I thought that by appending the line with 'return' I would end that line and write the second dgtext to the next line.
set the itemDelimiter to tab
put false into pFirstLineContainsHeaders
set the dgtext of group "datagridOutput" to "Saturation Conditions" & tab & empty & tab & "Liquid" & tab & "Vapor" & return
set the dgtext of group "datagridOutput" to "Pressure" & tab & "(bar)" & tab & DisplayOutputValue(Psat) & tab & DisplayOutputValue(Psat) & tab & return
Using this method to write to dgtext, how can I force the second text to write to the line below?
Thanks in advance...pwr
Getting started with datagrid
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Indeed, setting dgText in a datagrid is just the same as loading a "table field" with tab and cr delimited items and rows.pwr wrote:I thought that by appending the line with 'return' I would end that line and write the second dgtext to the next line.
The thing is, you have "set the dgText of group..." twice. Each time you set the dgText, you will set the text for the whole grid. You would be better to
Code: Select all
put "Saturation Conditions" & tab & empty & tab & "Liquid" & tab & "Vapor" & return into myDGText
put "Pressure" & tab & "(bar)" & tab & DisplayOutputValue(Psat) & tab & DisplayOutputValue(Psat) & tab & return after myDGText
set the dgtext of group "datagridOutput" to myDGText