; search FOO
mov psSecurityID.dwTotalSize,sizeof psSecurityID;
mov al, byte ptr[cDirNumber]
mov psSecurityID.cDirNumber,al
invoke lstrcpy,addr psSecurityID.szSymbol,"FOO"
mov psSecurityID.cPeriodicity,"I";
mov psSecurityID.wInterval,60;
invoke MSFL1_GetSecurityHandle,addr psSecurityID,addr hSecurity;
;if not find FOO then add FOO
.if eax!=MSFL_NO_ERR
mov psSecurityInfo.dwTotalSize ,sizeof psSecurityInfo;
invoke lstrcpy,addr psSecurityInfo.szName,"Foo Company"
invoke lstrcpy,addr psSecurityInfo.szSymbol,"FOO"
mov psSecurityInfo.cPeriodicity , "I"; intraday
mov psSecurityInfo.wInterval,60;60 sec
mov eax,iDate;
mov psSecurityInfo.lFirstDate, eax;
mov psSecurityInfo.lLastDate, eax;
mov psSecurityInfo.lCollectionDate,eax
mov psSecurityInfo.wDataAvailable , MSFL_DATA_DATE + MSFL_DATA_TIME + MSFL_DATA_OPEN + MSFL_DATA_HIGH + MSFL_DATA_LOW + MSFL_DATA_CLOSE + MSFL_DATA_VOLUME;
invoke MSFL1_AddSecurity,cDirNumber,addr psSecurityInfo,0
.endif
; and write price data of FOO
mov eax,iDate
mov psPriceRec.lDate,eax
mov eax,iTime;
mov psPriceRec.lTime,eax
invoke crt_sscanf, "1.1",CTXT("%f"),addr lpOut
mov eax,lpOut
mov psPriceRec.fOpen,eax
invoke crt_sscanf, "3.3",CTXT("%f"),addr lpOut
mov eax,lpOut
mov psPriceRec.fHigh,eax
invoke crt_sscanf, "1.1",CTXT("%f"),addr lpOut
mov eax,lpOut
mov psPriceRec.fLow,eax
invoke crt_sscanf, "2.2",CTXT("%f"),addr lpOut
mov eax,lpOut
mov psPriceRec.fClose,eax
invoke crt_sscanf, "10000.0",CTXT("%f"),addr lpOut
mov eax,lpOut
mov psPriceRec.fVolume,eax
mov psPriceRec.wDataAvailable, MSFL_DATA_DATE + MSFL_DATA_TIME + MSFL_DATA_OPEN + MSFL_DATA_HIGH + MSFL_DATA_LOW + MSFL_DATA_CLOSE + MSFL_DATA_VOLUME;
invoke MSFL1_GetSecurityHandle,addr psSecurityID,addr hSecurity;
invoke MSFL1_LockSecurity,hSecurity,MSFL_LOCK_FULL_LOCK
invoke MSFL1_WriteDataRec,hSecurity,addr psPriceRec,1
invoke MSFL1_UnlockSecurity,hSecurity