[求助]代码捉虫
3小时前 13

 

 

_SUB MainWindow,W300H400,软件列表选择,,%windir%\system32\shell32.dll#316,15,,-top -disminb
    SWIN :SWIN1,L10T40W273H280,,0x140
    LABE TitleLabel,L10T15W200H25,请选择要安装的软件:
    ITEM OKButton,L125T320W60H30,安装,CALL OnOK
_END

_SUB SWIN1,H600
    ENVI &YPos=10
    ENVI &Index=0
    ENVI &inList=0
    ENVI AllList=
    SET$ NL=0D 0A

    READ list.ini,*,&&AllContent

    FORX *NL &AllContent,&&line,
    {
        mstr * &line1=1,1,&line
        find $%&line1%=[,
        {
            find $%&line%=[softlist], ENVI &inList=1!ENVI &inList=0
        }!
        {
            IFEX $%&inList%=1, 
            {
                FIND $%&line%=!, CONTINUE
                MSTR * -delims:| SoftName,SoftPath,SoftStatus=<1><2><3>&line
                CHEK Checkbox_%&Index%,L40T%&YPos%W250H20,%SoftName%
                IFEX $%SoftStatus%=0,ENVI @Checkbox_%&Index%.Check=1
                IFEX $%SoftStatus%=2,team ENVI @Checkbox_%&Index%.Check=1|ENVI @Checkbox_%&Index%.Enable=0
                
                ENVI &Checkbox_Name=Checkbox_%&Index%
                ENVI &Checkbox_Name_Path=%SoftPath%
                ENVI Checkbox_Name_Status=%SoftStatus%

                CALC &YPos=%&YPos% + 25
                CALC &Index=%&Index% + 1
                
                ENVI AllList=%Checkbox_Name_Path%%NL%%AllList%
            }
        }
    }

    ENVI TotalCount=%&Index%

_END

_SUB OnOK
ENVI &AllList=%AllList%

ENVI &InstPath=
ENVI &Index=0

    LOOP $%&Index% <= %TotalCount%, 
    {
        READ  -*,%&Index%,&InstPath,&AllList
        Find $%Checkbox_%&Index%.Check%=1,mess Checkbox_%&Index%选中\n%&InstPath%
        CALC &Index=%&Index% + 1
    }
_END

CALL @MainWindow

 

七拼八凑写了个软件安装管理器,代码如上,发现个很奇怪的问题,软件列表文件如下:

[softlist]
sougouinput|C:\Program Files\SogouInput\install.exe /s|0
inputset|C:\Program Files\SogouInput\config.exe /s|0
Applelogin|C:\Program Files\AppleLogin\setup.exe|1
netset|C:\Program Files\NetSoftware\install.exe /s|2
QQ2009|C:\Program Files\Tencent\QQ2009\set2up.exe|1
xunlei2|C:\Program Files\Thunder\inst2all.exe|0

 

程序运行没问题,但是,只要软件列表软件超过10行,比如:

[softlist]
sougouinput|C:\Program Files\SogouInput\install.exe /s|0
inputset|C:\Program Files\SogouInput\config.exe /s|0
Applelogin|C:\Program Files\AppleLogin\setup.exe|1
netset|C:\Program Files\NetSoftware\install.exe /s|2
QQ2009|C:\Program Files\Tencent\QQ2009\set2up.exe|1
xunlei2|C:\Program Files\Thunder\inst2all.exe|0
netset|C:\Program Files\NetSoftware\install.exe /s|2
QQ2009|C:\Program Files\Tencent\QQ2009\set2up.exe|1
xunlei2|C:\Program Files\Thunder\inst2all.exe|0
netset|C:\Program Files\NetSoftware\install.exe /s|2
QQ2009|C:\Program Files\Tencent\QQ2009\set2up.exe|1

 

 

程序就只能识别前两行?请问各位高手,哪里出的问题?

奖励
收藏
点赞
分享
最新回复 (1)
  • avatar image
    dhwc 3小时前
    楼主   2

    是变量大小有限制吗?

返回