Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
str.setfile problem
#1
Hi, Gintaras~!

Now I'm making database based on INI file (because I don't have any knowledge on EXCEL, SQL .. etc)
using 'rget' 'rset' like below (a function to search in INI).

anyway, I don't get str.setfile, I used setfile "Found.setfile(searchresult 0 -1 4)" but it only write the last found.
What should I do for this?

Code:
Copy      Help
str inifile = "D:\Customer\INI\CINFO.ini"
str searchfile = "D:\Customer\INI\CSEARCH.ini"
str searchresult = "D:\Customer\INI\CS_RESULT.txt"

iff(searchresult)
    del- searchresult

str dd=
BEGIN DIALOG
0 "" 0x90C80AC8 0x0 0 0 176 114 "검색"
3 Edit 0x54030080 0x200 48 13 96 12 ""
4 Edit 0x54030080 0x200 48 37 96 12 ""
5 Edit 0x54030080 0x200 48 62 20 12 ""
6 Edit 0x54030080 0x200 80 62 20 12 ""
7 Edit 0x54030080 0x200 48 81 20 13 ""
8 Edit 0x54030080 0x200 80 81 20 13 ""
9 Static 0x54000000 0x0 15 16 28 12 "이   름"
10 Static 0x54000000 0x0 15 41 28 13 "전   화"
11 Static 0x54000000 0x0 15 65 28 13 "시작일"
12 Static 0x54000000 0x0 15 85 28 12 "종료일"
13 Button 0x54032000 0x0 116 64 46 38 "검   색"
14 Static 0x54000000 0x0 72 64 4 12 "/"
15 Static 0x54000000 0x0 72 83 4 12 "/"
END DIALOG
DIALOG EDITOR: "" 0x2040307 "*" "" "" ""

str controls = "3 4 5 6 7 8"
str e3 e4 e5 e6 e7 e8
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

str inifile = "D:\Customer\INI\CINFO.ini"
str searchfile = "D:\Customer\INI\CSEARCH.ini"
str searchresult = "D:\Customer\INI\CS_RESULT.txt"
str Sname Sphone SSmm SSdd SShh SEmm SEdd SEhh SRCH Found Result
str Rname Rphone RSmm RSdd RShh REmm REdd REhh ComNum
int N
ARRAY(str) Vname.createlb(100 1)
ARRAY(str) Vphone.createlb(100 1)
ARRAY(str) VSmm.createlb(100 1)
ARRAY(str) VSdd.createlb(100 1)
ARRAY(str) VEmm.createlb(100 1)
ARRAY(str) VEdd.createlb(100 1)

sel message
    case WM_INITDIALOG
    case WM_DESTROY
        ret
    case WM_COMMAND goto messages2
ret
messages2
sel wParam
    case EN_CHANGE<<16|3
        Sname.getwintext(lParam)
        rset Sname "NAME" "SEARCH" searchfile
    case EN_CHANGE<<16|4
        Sphone.getwintext(lParam)
        rset Sphone "PHONE" "SEARCH" searchfile
    case EN_CHANGE<<16|5
        SSmm.getwintext(lParam)
        rset SSmm "S_MONTH" "SEARCH" searchfile
    case EN_CHANGE<<16|6
        SSdd.getwintext(lParam)
        rset SSdd "S_DATE" "SEARCH" searchfile
    case EN_CHANGE<<16|7
        SEmm.getwintext(lParam)
        rset SEmm "E_MONTH" "SEARCH" searchfile
    case EN_CHANGE<<16|8
        SEdd.getwintext(lParam)
        rset SEdd "E_DATE" "SEARCH" searchfile
    case 13
        rget Sname "NAME" "SEARCH" searchfile ; Sname.trim
        if !(empty(Sname))
            N=0
            rep 100
                N+1
                rget Vname[N] "Vname" SRCH.format("VM-%i" N) inifile
                Vname[N].trim
                if (Vname[N] = Sname)
                    rget Rphone "Vphone" SRCH.format("VM-%i" N) inifile
                    rget RSmm "VSmm" SRCH.format("VM-%i" N) inifile
                    rget RSdd "VSdd" SRCH.format("VM-%i" N) inifile
                    rget RShh "VShh" SRCH.format("VM-%i" N) inifile
                    rget REmm "VEmm" SRCH.format("VM-%i" N) inifile
                    rget REdd "VEdd" SRCH.format("VM-%i" N) inifile
                    rget REhh "VEhh" SRCH.format("VM-%i" N) inifile
                    rget ComNum "ComNum" SRCH.format("VM-%i" N) inifile
                    Found.format("VM-%i (JL-%s) : %s  %s  %s/%s %s:00 - %s/%s %s:00[]" N ComNum Vname[N] Rphone RSmm RSdd RShh REmm REdd REhh)
                    out Found
                    Found.setfile(searchresult 0 -1 4)
ret 1
#2
Try this:
"Found.setfile(searchresult -1 -1 4)"
#3
Thank You!! It works...


Forum Jump:


Users browsing this thread: 1 Guest(s)