Thank you Bruce for your support.
I finally sort it out. Cause I did not find the way to determine content of fields in p_file (parameter of SaveForm),
I added new method to your NetWebServerWorker and it dump fields of requested file to dump file. This procedure may be improved a lot but it done job for me. I will put it in the end of this message and if you find it useful you may it include it in NetWeb class. This procedure is a modified procedure from Clarion help file
Best regards,
Djole
NetWebServerWorker.File2TXT PROCEDURE (*FILE pGrp) ! Declare Procedure
MAP
DumpGroupDetails PROCEDURE(USHORT start, USHORT total)
DumpFieldDetails PROCEDURE(USHORT indent, USHORT FieldNo)
SetAttribute PROCEDURE(SIGNED Prop,STRING Value)
StartLine PROCEDURE(USHORT indent,STRING label, STRING type)
Concat PROCEDURE(STRING s)
AddLineNo PROCEDURE
END
LineSize EQUATE(255)
FileIndent EQUATE(2)
TheFile &FILE
FileLabel STRING(30)
FlKey &KEY
Line STRING(LineSize)
FullText STRING(16384)
Blobs LONG
St StringTheory
FldPtr ANY
Prefix STRING(10)
LENPre SHORT
Sl StringTheory
LineNo LONG
CODE
LineNo = 0
TheFile &= pGrp
Sl.SetValue('')
AddLineNo
Sl.AddLine(LineNo,'File:'&TheFile{PROP:Name})
Prefix = TheFile{PROP:Label,1}
LENPre = INSTRING(':', Prefix, -1, LEN(CLIP(Prefix)))
IF LENPre
Prefix = Sub(Prefix,1,LENPre)
END
AddLineNo
Sl.AddLine(LineNo,'PREFIX:'&Prefix)
DO DumpMemosBlobs
AddLineNo
Sl.AddLine(LineNo,'RECORD')
DumpGroupDetails(0, TheFile{PROP:Fields})
Sl.AddLine(LineNo,'END RECORD')
sl.Join('<13,10>')
Sl.SaveFile('DUMPRECS.TXT',1)
Return !St.GetVal()
DumpMemosBlobs ROUTINE
DATA
x UNSIGNED,AUTO
TypeMemo STRING(20)
CODE
LOOP X = 1 TO (TheFile{PROP:Memos} + TheFile{PROP:Blobs})
AddLineNo
Sl.AddLine(LineNo,'BLOB_MEMO '&Clip(X))
IF UPPER (TheFile{PROP:type, -X}) = 'MEMO'
TypeMemo = 'MEMO('&CLIP(TheFile{PROP:Size, -X})&')'
ELSE
TypeMemo = 'BLOB'
END
AddLineNo
Sl.AddLine(LineNo,'Type:'&TypeMemo)
END
DumpGroupDetails PROCEDURE(USHORT start, USHORT total)
fld USHORT
fieldsInGroup USHORT
GroupIndent USHORT,STATIC,AUTO
GrpName STRING(20)
CODE
GroupIndent += 2
LOOP fld = start+1 TO start+total
DumpFieldDetails(GroupIndent,fld)
IF TheFile{PROP:Type,fld} = 'GROUP'
GrpName = TheFile{PROP:Label,fld}
GrpName = GrpName[LenPre + 1 : LEN(CLIP(GrpName))]
AddLineNo
Sl.AddLine(LineNo,'GROUP:'&Clip(GrpName))
fieldsInGroup = TheFile{PROP:Fields,fld}
DumpGroupDetails (fld, fieldsInGroup)
AddLineNo
Sl.AddLine(LineNo,'END GROUP')
fld += fieldsInGroup
END
END
GroupIndent -= 2
DumpFieldDetails PROCEDURE(USHORT indent, USHORT FieldNo)
FldType STRING(20)
FldPicture STRING(50)
FldSize STRING(20)
FldDIM STRING(20)
FldOver STRING(20)
FlVal ANY
grp &GROUP
DecPlac BYTE
Pict STRING(20)
FldName STRING(40)
lp String(80)
CODE
grp &= pGrp{PROP:Record}
FldType = TheFile{PROP:Type,FieldNo}
AddLineNo
Sl.AddLine(LineNo,'FIELD')
FldName = TheFile{PROP:Label,FieldNo}
FldName = FldName[LenPre + 1 : LEN(CLIP(FldName))]
AddLineNo
Sl.AddLine(LineNo,'Name:'&FldName)
StartLine(indent,FldType,'')
IF INSTRING('STRING', FldType, 1, 1)
Concat('(')
IF TheFile{PROP:Picture, FieldNo}
Concat(TheFile{PROP:Picture, FieldNo})
ELSE
Concat(TheFile{PROP:Size, FieldNo})
END
Concat(')')
ELSIF INSTRING('DECIMAL', FldType, 1, 1) OR INSTRING('PDECIMAL', FldType, 1,1)
Concat('(' & TheFile{PROP:Size, FieldNo} & ',' & |
TheFile{PROP:Places, FieldNo} & ')')
DecPlac = TheFile{PROP:Places, FieldNo}
END
IF TheFile{PROP:Dim,FieldNo} <> 0
Concat(',DIM(' & CLIP(TheFile{PROP:Dim,FieldNo}) & ')')
END
IF TheFile{PROP:Over, FieldNo} <> 0
Concat(',OVER(')
IF TheFile{PROP:Label, TheFile{PROP:Over, FieldNo}}
Concat(CLIP(TheFile{PROP:Label, TheFile{PROP:Over, FieldNo}}))
ELSE
Concat('field ' & TheFile{PROP:Over, FieldNo})
END
Concat(')')
END
AddLineNo
Sl.AddLine(LineNo,'Type:'&Clip(LINE))
FlVal = What(grp,FieldNo)
if TheFile{PROP:Picture, FieldNo}
Pict = TheFile{PROP:Picture, FieldNo}
AddLineNo
Sl.AddLine(LineNo,'Value:'&Format(FlVal,Pict))
ELSE
CASE FldType
of 'DATE'
AddLineNo
Sl.AddLine(LineNo,'Value:'&Format(FlVal,@d06.b))
of 'TIME'
AddLineNo
Sl.AddLine(LineNo,'Value:'&Format(FlVal,@t04b))
of 'DECIMAL'
orof 'PDECIMAL'
Pict = '@-n12.'&Clip(DecPlac)
FldName = Clip(FlVal)
AddLineNo
Sl.AddLine(LineNo,'Value:'&FldName)
ELSE
AddLineNo
Sl.AddLine(LineNo,'Value:'&Clip(FlVal))
END
END
AddLineNo
Sl.AddLine(LineNo,'END FIELD')
SetAttribute PROCEDURE (Prop,Value)
CODE
IF Prop THEN Line = CLIP(Line) & ',' & CLIP(Value).
StartLine PROCEDURE (USHORT indent,STRING label, STRING type)
spaces USHORT,AUTO
clen LONG,AUTO
CODE
line = label
clen = LEN(CLIP(line))
IF clen < Indent
spaces = Indent - clen
ELSE
spaces = 4
END
line = CLIP(line) & ALL(' ', spaces) & type
Concat PROCEDURE (STRING s)
CODE
Line = CLIP(Line) & s
AddLineNo PROCEDURE
CODE
LineNo += 1