镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

String enums causes compilation error #366

Open

Description

Tested enum:

Image

Case 1: Use enum as parameter of a command:

{$CLEO}
{$USE SAMPFUNCS}
NOP

if File fileAHandle = open_file {filePathName} "cleo:\cleo_plugins\SA.Math.cleo" {mode} FileMode.ReadBinary
then
    // do something
    close_file fileAHandle
end

{0A93:} terminate_this_custom_script

Image

Case 2: Use enum as conditional statement

{$CLEO}
{$USE text}
{$USE SAMPFUNCS}
NOP

int compareStr
// do something to store a stringpointer at comparePtr
if compareStr == FileMode.AppendText // <-- synonymous to Text.IsEqual(comparePtr,FileMode.AppendText)
then // both strings are equal
else // both strings aren't equal
end

terminate_this_custom_script

Image

Case 3: Use enum as a constant

{$CLEO}
{$USE SAMPFUNCS}
NOP

const FILEMODE = FileMode.WriteBinary

if File fileAHandle = open_file {filePathName} "cleo:\cleo_plugins\SA.Math.cleo" {mode} FILEMODE
then
    // do something
    close_file fileAHandle
end

terminate_this_custom_script

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions