View Single Post
Old 04-09-2023, 02:45 PM   #565
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,050
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I have this template for a composite column used for sorting in one VL/view manager view.

Code:
program:
## This one checks that #kobostatus has a value. If it does, return 'no' if it matches two specific criteria, and 'yes' otherwise.
	if 
		$#kobostatus
	then 
		switch_if(
			'\[(Add|Send) to Device\]' in $#kobostatus, 'No',
			$#kobostatus=='[Kobo Store]' && !$#kobodate, 'No',
		 	'Yes'
		)		
	fi
Functionally, this should do the same thing:

Code:
program: 
## This returns an empty if #kobostatus doesn't have a value. Other lines are unaffected.
	switch_if(
		!$#kobostatus, '',
## Alternate: $#kobostatus=='',
		'\[(Add|Send) to Device\]' in $#kobostatus, 'No',
		$#kobostatus=='[Kobo Store]' && !$#kobodate, 'No',
	 	'Yes'
	)
Would either of them be particularly faster?

Last edited by ownedbycats; 04-09-2023 at 02:59 PM.
ownedbycats is offline   Reply With Quote