OROS社 OR30シリーズ技術サポート
NVGS_GetFilePosition
Declaration
C++ : int NVGS_GetFilePosition(int nTrack, int *pnNbrRecord, long *pnNbrSample);
VB : Function NVGS_GetFilePosition (ByVal nTrack As Long,
ByRef pnNbrRecord As Long,
ByRef pnNbrSample As Long) As Long
Description
指定されたトラックの現在のレコードとサンプル位置を返します
Parameters
nTrack | 現在位置を取得するトラック番号 |
pnNbrRecord | 現在のレコード値を取得するポインタ |
pnNbrSample | 現在のサンプル位置を取得するポインタ |
Return value
成功した場合、0、そうでなければ ?1
Examples
Visual C++:
#include "EntryPoint.h” long nNbrTrack = NVGS_GetNumberOfTrack(); long track; long nbrpts; int nCurrentRec; long nCurrentSample; float **data; data = (float**)malloc(sizeof(float*)*nNbrTrack); for (track=1; track<=nNbrTrack+1 ; track++) { data[track-1] = (float*)malloc(sizeof(float)*NVGS_DATA_BLOCK_SIZE); } // Read all the data on all the track in the first record if (NVGS_SetFilePosition(0, 0)) { do { // Read points for each track in ORXF file //--------------------------------------- for (track=1; track<=nNbrTrack+1 ;track++) { nbrpts = NVGS_ReadData(track, data[track-1]); if (nbrpts == -1) return -1; NVGS_GetFilePosition(track, &nCurrentRec, &nCurrentSample); printf (“Track %d, Current record : %d, Current Sample : %s\n” , track, nCurrentRec, nCurrentSample); } } while (nbrpts > 0); } else { return -1; }
Visual Basic
Dim nNbrTrack As Integer Dim track As Integer Dim nbrpts As Integer Dim nCurrentRec As Integer Dim nCurrentSample As Integer Dim TabData(1024) As Single nNbrTrack = NVGS_GetNumberOfTrack() res = NVGS_SetFilePosition(0, 0) if (res = 0) Then do While nbrpts > 0 ' Read points for each track in ORXF file '--------------------------------------- for track = 1 to nNbrTrack+1 Step 1 nbrpts = NVGS_ReadData(track, TabData[0]) NVGS_GetFilePosition(track, nCurrentRec, nCurrentSample) ' Current Record for track “track” is : nCurrentRec ' Current sample position for track “track” is : nCurrentSample Next track Loop Else ret2 = MsgBox("Error when setting file position.", vbOKOnly, "Error") End if
See also