Date fromDays:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Date fromDays:

Sebastia Van Lacke
Hi, I need to use the Squeak method Date>>fromDays:, and it is not available in my current version of GLASS.
I thought that maybe it was in some squeak package, so I've loaded the last version of Squeak package from Monticello, but unfortunately an error occured durring the installation, and now the monticello system is broken. I get an error when selecting a version from the list.
 
Character does not understand charCode, when executing:
 
isSafeForHTTP
 "whether a character is 'safe', or needs to be escaped when used, eg, in a URL"
 
 ^ self charCode < 128
  and: [ self isAlphaNumeric
    or: [ '.-_' includes: self ]]
 
and the character is $S
 
Now I can't load any package, because I can't select a version to load.
 
Any idea?
 
Sebastian
Reply | Threaded
Open this post in threaded view
|

Re: Date fromDays:

Dale Henrichs
Sebastian Van Lacke wrote:

> Hi, I need to use the Squeak method Date>>fromDays:, and it is not available in my current version of GLASS.
> I thought that maybe it was in some squeak package, so I've loaded the last version of Squeak package from Monticello, but unfortunately an error occured durring the installation, and now the monticello system is broken. I get an error when selecting a version from the list.
>
> Character does not understand charCode, when executing:
>
> isSafeForHTTP
>  "whether a character is 'safe', or needs to be escaped when used, eg, in a URL"
>
>  ^ self charCode < 128
>   and: [ self isAlphaNumeric
>     or: [ '.-_' includes: self ]]
>
> and the character is $S
>
> Now I can't load any package, because I can't select a version to load.
>
> Any idea?
>
> Sebastian
>

Sebastion,

The implementation of #charCode is:

charCode
        "assuming Unicode"
       
        ^(self asciiValue bitAnd: 16r3FFFFF)

which you can patch and then reload the previous version of Squeak...

In general, you should do a backup before loading code, so that
recovering is as simple as restoring from backup (w/o tranlogs) ... on
the Admin menu.

Secondly, when you move to a new version of GLASS (loading the basic
packages), you should sue the Update GLASS menu item ... in the case you
  hit, the method #charCode was probably moved from the Squeak package
to the core package ... something that is handled correctly by the
Update GLASS menu item, but which can lead to trouble when you manually
load things.

Finally, you are correct that Date class>>fromDay: is available in a
later version of the Squeak package, so an Update GLASS should get you
to where you want to be.

Oh, don't forget to make a backup before doing the update glass:)

Dale