Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CVS file not displaying correctly in QMGrid
#1
Gintaras
I am working a program that help put serial numbers for ILO on HP platforms. If there is a space after the 25 character license it strips the first letter off of the very next row. You would get 0006228 instead of 30006228 in this script. I attached a screen shot of the appropriate part of the program. It there a way around this so it displays properly?

Function IloKey2
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str qmg3x
if(!ShowDialog("IloKey2" &IloKey2 &controls)) ret


;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 286 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 QM_Grid 0x56031041 0x0 0 0 280 114 "0x12,0,0,0,0x0[]CPU,,,[]IP,,7,"
;END DIALOG
;DIALOG EDITOR: "" 0x2030605 "*" "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG goto gInit
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto gNotify
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
;_______________________

;gInit
str csv=
;30006116,XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
;30006228,XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
;30006300,XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
csv.trim
ICsv- t_csv=CreateCsv(1)
t_csv.FromString(csv)
t_csv.ToQmGrid(id(3 hDlg))

ret
;_______________________

;gNotify
NMHDR* nh=+lParam
sel nh.idFrom
,case 3
,NMITEMACTIVATE* na=+nh
,sel nh.code
,,case NM_CLICK ;;when user clicks a row or empty space, and it does not begin cell edit mode
,,if(na.iItem<0) ret
,,out "row click: %i %i" na.iItem na.iSubItem
,,str IP=t_csv.Cell(na.iItem 1)
,,mes IP


Attached Files Image(s)
   
#2
Thank you, will fix it in next QM.
Enclose in "
Macro Macro2240
Code:
Copy      Help
str csv=
;30006116,"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX "
;30006228,"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX "
;30006300,"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX "
csv.trim
ICsv- t_csv=CreateCsv(1)
t_csv.FromString(csv)
t_csv.ToString(_s)
out _s


Forum Jump:


Users browsing this thread: 1 Guest(s)