def item_rect(index)
rect = Rect.new
rect.width = item_width
rect.height = item_height
rect.x = index % col_max * (item_width + spacing)
rect.y = index / col_max * item_height
rect
end
I'm still learning and would like to understand why the "/" in the rect.y line throws the formatting off for the rest of the script in notepad ++.
Window_Selectable throws a formatting error in external editor. Why?
● ARCHIVED · READ-ONLY
-
-
this is normal
/ = a way to seperate stuff and this can be use in string seperation like this
:
Code:module Cachedef self.something(filename)load_bitmap("Graphics/Something/",filename)endend -
@nio, I don't think that's the exact answer, the slash in your example used to move/look into a specific directory(folder in this case).
Three things that I know:
Usually forward slash is a divison operator used for math purpose, the other things that I know, forward slash is used for regexp too. And the last thing I know, it's like your answer, it used for separate between directory.
#OP
Hmm, It's not only in notepad++, I tried it to in sublime text and it does the same thing, athough it's not break the rest of code. I believe the "index" in front of "/" is the culprit, but I don't know why, oh well I think I'll stick with this post, maybe there's someone can explain this =) -
oups made the error D: sorry! well you mean the same thing of what I wanted truly to say XD@nio, I don't think that's the exact answer, the slash in your example used to move/look into a specific directory(folder in this case).
Three things that I know:
Usually forward slash is a divison operator used for math purpose, the other things that I know, forward slash is used for regexp too. And the last thing I know, it's like your answer, it used for separate between directory.
#OP
Hmm, It's not only in notepad++, I tried it to in sublime text and it does the same thing, athough it's not break the rest of code. I believe the "index" in front of "/" is the culprit, but I don't know why, oh well I think I'll stick with this post, maybe there's someone can explain this =) -
The coloring in program editors is always based on the language used - a really good editor let's you choose the coloring scheme depending on the filetype, and then the coloring is different depending on whether you write a program for pascal, C++, html or whatever.
However, if the editor hasn't been told what language is written (or if he simply don't have support for that language), then the coloring changes can be off in any way, simply because the editor applies format changes based on entirely different program structures.
That is NOT a bug, it simply means that your editor doesn't support (or doesn't recognize) the programming language of the current file. -
Can you show a screenshot? I put that into Notepad++ and it does absolutely nothing.
Is your file saved? What's the extension? Notepad might format according to file extension. Then you may be able to set up other rules that affects its behaviour too.
Anyway, this is not really a scripting issue - more an editor issue, so I'm going to move this to Program and Utility Discussion