[futurebasic] Data displays incorrectly

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2009 : Group Archive : Group : All Groups

From: Brian Stevens <bstevens33@...>
Date: Tue, 2 Jun 2009 14:13:47 -0700
Scenario:  UB app runs without incident on OS X 10.5.7 Intel machine  
but data displays incorrectly on OS X 10.4.11 PowerPC machine. My  
first reaction to the report was an Endian issue but I'm not sure.   
Without immediate access to a PowerPC machine and OS X 10.4 I'm  
looking at code hoping to solve this.

(1) The data ( 21.99 ) displays incorrectly as '...1.99'

(2) Data is stored in a FB dynamic array or records such as the one  
below ( gTheRec ).

(3) The 'cost' field contains the data. Note it is a string which  
typically doesn't present Endian issues

(4) Data is read from the file once at startup using: 'read dynamic  
#1, gTheRec' and written as needed using 'write dynamic #2, gTheRec'

(5) Data is populated into another dynamic array which is used to  
populate the data browser. This is a line I'm wondering about because  
it creates a numeric value ( with 'val' ) which might have a Endian  
issue. gBrowser.cost is defined as a pascal string Str15.

gBrowser.cost( i )           = using  
"$#,###,###.##";val( gTheRec.cost( foundPos ) )

(6) When the cost data is retrieved after user input ( i.e. from an  
edit field ), it is treated completely as a pascal string
gTheRec.cost( nextItem )       = fn GetButtonByIDText$( w, _cost ) //  
this fn does a GetControlData for _kControlEditTextPart


There are other ( probably ) unrelated issues with combo boxes not  
displaying data even though the data shows up when the user types a  
character in the enterable field portion of the combo box.

All thoughts welcome. Thank you. Brian S.


begin record MyRecord
dim as Str63               a
dim as Str63               b
dim as Str63               c
dim as UInt32              d
dim as CFAbsoluteTime      e
dim as Str15               cost
end record

dynamic gTheRec(_maxLong) as MyRecord