为什么purebasic chilkat模块30天试用版激活语法失败?

时间:2019-03-15 18:39:08

标签: chilkat

尝试在纯基本版本5.70 LTS上激活30天试用版,但使用发布的代码,在检查语法时返回以下错误。 (如果有任何区别,请在64位w7计算机上使用32位版本)

我正在使用:

  

Dim glob作为新的Chilkat.Global glob.UnlockBundle(“开始我的30天   试用”)

并获得以下错误:

  

第4行“昏暗”的系统税是:昏暗的名字(nb)。

1 个答案:

答案 0 :(得分:0)

Dim用于定义数组。要定义一个由3个字符串组成的数组,请编写

Dim names.s(2)
  • .s表示它是一个字符串数组。
  • 2表示可用的最高索引。因此,从0开始计数,这意味着三个插槽:0、1和2。

根据Chilkat网站的PureBasic module,要解锁捆绑包,您应该按照以下示例进行操作。

IncludeFile "CkGlobal.pb"

Procedure ChilkatExample()

    ; The Chilkat API can be unlocked for a fully-functional 30-day trial by passing any
    ; string to the UnlockBundle method.  A program can unlock once at the start. Once unlocked,
    ; all subsequently instantiated objects are created in the unlocked state. 
    ; 
    ; After licensing Chilkat, replace the "Anything for 30-day trial" with the purchased unlock code.
    ; To verify the purchased unlock code was recognized, examine the contents of the LastErrorText
    ; property after unlocking.  For example:
    glob.i = CkGlobal::ckCreate()
    If glob.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success.i = CkGlobal::ckUnlockBundle(glob,"Anything for 30-day trial")
    If success <> 1
        Debug CkGlobal::ckLastErrorText(glob)
        CkGlobal::ckDispose(glob)
        ProcedureReturn
    EndIf

    status.i = CkGlobal::ckUnlockStatus(glob)
    If status = 2
        Debug "Unlocked using purchased unlock code."
    Else
        Debug "Unlocked in trial mode."
    EndIf

    ; The LastErrorText can be examined in the success case to see if it was unlocked in
    ; trial more, or with a purchased unlock code.
    Debug CkGlobal::ckLastErrorText(glob)


    CkGlobal::ckDispose(glob)


    ProcedureReturn
EndProcedure