[Sigh] You old pirate you
Would strict checking catch this, as it does in Perl and other lingoes?
Rescaling a selected image from album on Android
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Rescaling a selected image from album on Android
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Rescaling a selected image from album on Android
Yes, but now I'm confused.
From the Main menu Edit > Preferences > Script Editor select Strict Compilation Mode
or
From the Script Editor menu Edit select Variable Checking
I know the second one works. Is it the same as the first one?
Simon
From the Main menu Edit > Preferences > Script Editor select Strict Compilation Mode
or
From the Script Editor menu Edit select Variable Checking
I know the second one works. Is it the same as the first one?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Rescaling a selected image from album on Android
First the good news: the delete now works and it fixes the situation of overlapping or non-resizing images. Left to do: Android reverses portrait and landscape (i.e. camera landscape = image portrait)
Hmmm don't think so: I'm getting different results for the "preferences" and the "variable checking" methods. The 2nd one seems stricter. I've declared a "local cProfileImage" at the top of the card script. Variable checking complains about the code snippet below with:
card "UserProfile": compilation error at line 28 (Chunk: can't create a variable with that name (explicitVariables?)) near "MaxHeight", char 12
whereas Preferences remains entirely happy (No errors occurred). Dunno what it's complaining about to be honest. Perhaps we should split into a new subject ...
Hmmm don't think so: I'm getting different results for the "preferences" and the "variable checking" methods. The 2nd one seems stricter. I've declared a "local cProfileImage" at the top of the card script. Variable checking complains about the code snippet below with:
card "UserProfile": compilation error at line 28 (Chunk: can't create a variable with that name (explicitVariables?)) near "MaxHeight", char 12
whereas Preferences remains entirely happy (No errors occurred). Dunno what it's complaining about to be honest. Perhaps we should split into a new subject ...
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
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Rescaling a selected image from album on Android
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
I think I have seen the flipped landscape/portrait but I don't recall a solution.
Simon
Edit; No I am wrong.
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.
Edit 2; in your strings.
Last edited by Simon on Tue Sep 02, 2014 8:53 pm, edited 2 times in total.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Rescaling a selected image from album on Android
Playing with that rotate/angle stuff right now, but this "flipping" thing is pretty resilient it appears When I get to grips with it I'll post of course. Thanks a zillion so far!
Michel J.L. van der Kleij
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl
Coding to help stray animals in the Philippines
Albert Foundation - http://albert.tukcedo.nl
Aklan Animal Rescue & Rehabilitation Center - http://aarrc.tukcedo.nl