PatMcLaughlin
Programmer
Hi Guys... I am working on a project, converting a foxpro program to VB.NET. I have conquered all except the data sort on 2 reports. The foxpro script looks like this
My VB.net code looks like this...
The mSortn and pSortn are numeric fields with up to 3 digits
The mSorta and pSorta are alpha fields
Here is my problem, The sorts Almost match. I believe my problem may be the STR() in the foxpro which I do not understand the syntax. (Why the ',3') Can you help me out?
Code:
CASE mSORT=1
INDEX ON DEPT + STR(MSORTN,3) + MSORTA + MODEL FOR QTY > 0 TO DLDSOP
CASE mSORT=2
INDEX ON DEPT + STR(PSORTN,3) + PSORTA FOR QTY > 0 TO DLDSOP
CASE mSORT=3
INDEX ON DEPT + STR(PSORTN,3) + PSORTA + STR(MSORTN,3) + MSORTA FOR QTY > 0 TO DLDSOP
Case mSort=4
INDEX ON DEPT+MH_LINE+DTOC(MH_DATE)+STR(SEQ_NO)+OPT+PART FOR QTY > 0 TO DLDSOP
Case mSort=5
INDEX ON DEPT+MH_LINE+ STR(MSORTN,3) + MSORTA+Model+Serial+DTOC(MH_DATE)+OPT+PART FOR QTY > 0 TO DLDSOP
*OTHERWISE
* INDEX ON DEPT+MH_LINE+DTOC(MH_DATE)+STR(SEQ_NO)+OPT+PART FOR QTY > 0 TO DLDSOP
Code:
If rdoModel.Checked = True Then
Mpp3DV.Sort = "mSortN, mSorta, Model"
ElseIf rdoPart.Checked = True Then
Mpp3DV.Sort = "psortn, psorta"
ElseIf rdoPartModel.Checked = True Then
Mpp3DV.Sort = "psortn, psorta, msortn, msorta"
ElseIf rdoLineSeq.Checked = True Then
Mpp3DV.Sort = "mh_line, seq_no, opt, part"
ElseIf rdoLineModel.Checked = True Then
Mpp3DV.Sort = "mh_line, msortn, msorta, model, serial, opt, part"
ElseIf rdoLineSeqOptPart.Checked = True Then
Mpp3DV.Sort = "mh_line, seq_no, opt, part"
Else
The mSorta and pSorta are alpha fields
Here is my problem, The sorts Almost match. I believe my problem may be the STR() in the foxpro which I do not understand the syntax. (Why the ',3') Can you help me out?