Welcome, Guest
Section to post tutorials on how to manage and read your eComics

TOPIC: Expressions

Expressions 4 years 6 months ago #34150

  • wojosama
  • wojosama's Avatar
  • Offline
  • Gold Boarder
  • Posts: 180
  • Thank you received: 45
  • Karma: 11
This is all about what you can use to make expression based smartlists. Much of what they can do can already be done the standard way, but that's not to say there aren't uses for them. Be creative!


Arithmetic Operators:
+
-
*
/
There are 3 arithmetic operators which I did not confirm: % (Modulus) ** (Exponent) // (Floor Division)

Comparison Operators:
==  Checks if the value is equal
<> and != checks if the value is not equal
> checks if left operand is greater than right
< checks if left operand is less than right
>= checks if left operand is greater than or equal to right
<= checks if the left operand is less than or equal to right

Logical Operators:
and
or
not


Usable Data Fields:
All usable data fields can be found by double clicking the text field and then in the window that pops up, press the insert value button and choose the field you want to use.

EXAMPLES:
Issues you made it past the first page but didn't make it to the last:
{CurrentPage} < {PageCount} and {CurrentPage} > 1

Made by cYo:
Count errors:
{StatsMaxCount}<>{StatsMinCount}
Ridiculous High Quality Comics (Size in Bytes):
{PageCount}>0 and ({FileSize}/{PageCount}>2000000)

Wojo's Low Quality Variant (issues you want to find better copies of):
{PageCount}>0 and ({FileSize}/{PageCount}<200000)


For more info on python expressions:
Basic Operators
Regular Expressions
Last Edit: 4 years 6 months ago by wojosama.
The administrator has disabled public write access.
The following user(s) said Thank You: cYo, perezmu, 600WPMPO, freMea, rmagere, Madmatx

Re: Expressions 4 years 6 months ago #34151

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 233
Wow! This is extremely useful!

+1 karma to my friend, the all-knowing Lord Wojo! :-)

p.s. I think all users (including cYo) should contribute to this thread, so that we may fill in any missing information.
Now Playing: The ComicRack Manual (Online)

See my new comics & gadgets on: Tumblr!
The administrator has disabled public write access.
The following user(s) said Thank You: wojosama

Re: Expressions 4 years 6 months ago #34153

  • cYo
  • cYo's Avatar
  • Offline
  • Moderator
  • Posts: 3476
  • Thank you received: 676
  • Karma: 182
You can double click the text field for the expression and get the extended expression editor which includes:

a) syntax coloring and
b) a button with the list of all possible fields
The administrator has disabled public write access.
The following user(s) said Thank You: 600WPMPO, Madmatx, wojosama

Re: Expressions 4 years 6 months ago #34154

  • wojosama
  • wojosama's Avatar
  • Offline
  • Gold Boarder
  • Posts: 180
  • Thank you received: 45
  • Karma: 11
:silly: . I've popped that box up 1000 times and never noticed that those were the expression fields (no idea what I thought they were, never thought much about it). Well I'll remove the data fields section of the post and replace it with where to find them. The rest I'll keep around, I'm sure it'll be useful to someone.


OP has been edited.
Last Edit: 4 years 6 months ago by wojosama.
The administrator has disabled public write access.

Re: Expressions 4 years 6 months ago #34155

  • cYo
  • cYo's Avatar
  • Offline
  • Moderator
  • Posts: 3476
  • Thank you received: 676
  • Karma: 182
The expression is a Python expression. So it can include anything that Python allows, including something like
any(char.isdigit() for char in {Series})

to return all series that contain digits.
The administrator has disabled public write access.
The following user(s) said Thank You: 600WPMPO

Re: Expressions 4 years 6 months ago #34156

  • wojosama
  • wojosama's Avatar
  • Offline
  • Gold Boarder
  • Posts: 180
  • Thank you received: 45
  • Karma: 11
I thought they were python expressions but I wasn't sure how intricate since I haven't seen anything too crazy. Can't wait to play with this now I know there's more to explore. Thanks for weighing in on this cYo.


EDIT: Adding 2 links to the OP, 1 for python basic operators and another for regular expressions. Someone might find them handy. I know I will. B)
Last Edit: 4 years 6 months ago by wojosama.
The administrator has disabled public write access.

Re: Expressions 4 years 6 months ago #34162

  • cYo
  • cYo's Avatar
  • Offline
  • Moderator
  • Posts: 3476
  • Thank you received: 676
  • Karma: 182
Regular expression support is also built into operators for text fields. No need to switch to Python expressions to use them (but you can).
The administrator has disabled public write access.
The following user(s) said Thank You: wojosama

Re: Expressions 4 years 6 months ago #34164

  • wojosama
  • wojosama's Avatar
  • Offline
  • Gold Boarder
  • Posts: 180
  • Thank you received: 45
  • Karma: 11
Thanks for clarifying. Haven't dealt with any of this kind of thing in many years so I'm still trying to regain my grasp.
The administrator has disabled public write access.

Re: Expressions 4 years 4 months ago #36068

  • Faba
  • Faba's Avatar
  • Offline
  • Senior Boarder
  • Posts: 43
  • Thank you received: 2
  • Karma: 0
Is it possible to check against another comics, something like
ComicA.filepath == ComicB.filepath

or in somekind of For loop?
The administrator has disabled public write access.

Re: Expressions 1 year 1 month ago #46510

  • Xelloss
  • Xelloss's Avatar
  • Online
  • Platinum Boarder
  • Posts: 463
  • Thank you received: 118
  • Karma: 24
This topic should be added to the Comicrack Manual, it is REALLY useful and quite hidden... (I didn't know about this till today... and I had used CR for years, even done scripts XD)
The administrator has disabled public write access.
Time to create page: 0.403 seconds

Who's Online

We have 312 guests and 2 members online