Skip to content

FIX() needs few fixes #2169

@alaingdl

Description

@alaingdl

Looking for a smart way to check whether a string can be converted into a float or an integer, I got some surprises :

Concerning Offset :

GDL> print, fix('AZz123eeee', 7)
    2560

IDL>  print, fix('AZz123eeee', 7)
% FIX: String expression not allowed in this context: <STRING   ('AZz123eeee')>.
% Execution halted at: $MAIN$  

Concerning type conversion 7 (string)

GDL> print, fix('123eeee', type=7)
free(): invalid pointer
/home/alaingdl/MonEnvironnement/bin/LastGDL : ligne 58 : 94441 Abandon                 (core dumped) $GDL_ROOT//last-gdl/mybuild_X11/bin/gdl $@

IDL> print, fix('123eeee', type=7)
123eeee

We also need to add that in the tests !!

((Since I am trying to deliver a cleaner READ_CSV() but encounter several troubles, I cannot have an eye on that))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions