找回密码
 点一下
查看: 1298|回复: 8

求解。。本人JASS超新手,求解这个JASS的错误

[复制链接]
发表于 2012-8-7 19:36:53 | 显示全部楼层 |阅读模式
function Math takes nothing returns nothing
    local integer math=4
    local integer math2=0
    loop
    exitwhen math==0
    if math2==0 then
    call DisplayTextToPlayer(Player(0),0,0,I2S(math2))
    math2=math2+1
    elseif math2 ==1 then
    call DisplayTextToPlayer(Player(0),0,0,I2S(math2))
    math2=math2+1
    elseif math2==2 then
    call DisplayTextToPlayer(Player(0),0,0,I2S(math2))
    math2=math2+1
    elseif math2==3 then
    call DisplayTextToPlayer(Player(0),0,0,I2S(math2))
    math2=math2+1
    elseif math2==4 then
    call DisplayTextToPlayer(Player(0),0,0,I2S(math2))
    math2=0
    endif
    set math==math-1
    endloop
endfunction


本人最近学习JASS。。测试一个按下ESC显示1-4的JASS,,结果错误了。。求解。
 楼主| 发表于 2012-8-7 19:48:17 | 显示全部楼层
。。这个==跟=有啥区别。。。为啥混用不可以呢- -
回复

使用道具 举报

发表于 2012-8-7 19:49:05 | 显示全部楼层
1:set math==math-1  这里是 = 号,不是 == 号

2:math2=math2+1 ,所有的赋值运算都需要 set

3:建议使用 JassCraft 来写代码,然后你可以看错误提示
回复

使用道具 举报

 楼主| 发表于 2012-8-7 19:50:41 | 显示全部楼层
八嘎.png 。。。。恶心一毛- -
回复

使用道具 举报

 楼主| 发表于 2012-8-7 19:53:50 | 显示全部楼层
解决啦。。。原来赋值的要用set 的- -。。。多谢啦、
回复

使用道具 举报

发表于 2012-8-7 19:57:01 | 显示全部楼层

回 asd8645123123 的帖子

asd8645123123: 。。这个==跟=有啥区别。。。为啥混用不可以呢- -(2012-08-07 19:48)嬀/color]
==是判断左右是否相等
=是赋值
回复

使用道具 举报

发表于 2012-8-28 18:09:11 | 显示全部楼层
啊啊啊啊啊
回复

使用道具 举报

发表于 2012-8-28 18:10:37 | 显示全部楼层
............
回复

使用道具 举报

发表于 2012-8-29 03:39:20 | 显示全部楼层
楼上在做什么!
禁止以无意义的内容屠版
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-1 02:48 , Processed in 0.190851 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表