

Would strict checking catch this, as it does in Perl and other lingoes?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
# an image was selected
put the formattedHeight of the last image into W
put the formattedWidth of the last image into H
set the name of the last image to "cProfileImage"
set the lockLoc of image "cProfileImage" to true
set resizeQuality of image "cProfileImage" to "good"
put W / H into AspectRatio
put round(MaxHeight * AspectRatio) into NewWidth
answer "W x H = " & W && "x" && H && "(" & AspectRatio & ")" & return & "New:" && NewWidth && "x" && MaxHeight with OK
lock screen
# first set the new dimensions
set the height of image "cProfileImage" to MaxHeight
set the width of image "cProfileImage" to NewWidth
# then position the scaled image
set the left of image "cProfileImage" to 40
set the top of image "cProfileImage" to 300
unlock screen
You'll now have to list all of your variables upfront just like you did with cProfileImage.card "UserProfile": compilation error at line 28 (Chunk: can't create a variable with that name (explicitVariables?)) near "MaxHeight", char 12
So that isn't going to help catch spelling mistakesVariable checking causes LiveCode to perform a stricter check
of your scripts. Using any variable without declaring it first, or
using a literal string without encloning it in quotes causes a
compile error. This behavior can be useful in tracking down
certain subtle problems such as misspelling a variable name.